Skip to content

Migrating from cPanel to Enhance — account-by-account runbook with mail, DB, files, and DNS

A full migration runbook from cPanel/WHM to Enhance Control Panel — what survives, what doesn't, how to move mail without losing IMAP state, and the cutover sequence we run in production.

Your cPanel/WHM box has been running for four years, the license is renewing, and somebody on the team has read enough about Enhance to ask if you should move. You can. It’s not push-button — there’s no pkgacct-to-Enhance importer the way there is between cPanel boxes — but every customer artifact has a path: files via rsync, MySQL/MariaDB via dump-and-restore, mail via imapsync or doveadm sync, DNS via zone-file translation, and account metadata (PHP version, mailboxes, FTP users) via Enhance’s API. The trap is doing it ad-hoc instead of phase-by-phase with a verification step after each chunk. Below is the runbook we run.

What’s happening

cPanel and Enhance store roughly the same artifacts but in different shapes. cPanel keeps a customer in /home/<user>/, with mail/, public_html/, MySQL databases owned by <user>_<dbname>, and zones in /var/named/. Enhance puts each customer’s sites under a structured customer directory, MySQL databases on a per-app-server MariaDB instance, mail in Dovecot maildirs that follow Enhance’s account model, and DNS records in the orchestrator (if you’re running Enhance as your DNS authority — many shops keep Cloudflare or external DNS and skip this).

There is no one-shot importer between the two panels (some third-party tools exist; results vary, and they tend to miss the long tail of edge cases). The practical move is a structured runbook: per-customer, in waves of 5-20 accounts, with a known cutover window and a known rollback. Each account moves in four phases:

  1. Provision the Enhance account. Create the customer + sites + databases + mailboxes in Enhance with the same passwords-on-file or freshly-generated ones, depending on whether you’re keeping the existing credentials. Make sure the PHP version matches, the DNS zone exists if Enhance is the new authority, and the destination disk has the space.
  2. Pre-sync data with TTLs lowered. Drop the customer’s DNS TTLs to 300, then run a first pass of rsync on files, mysqldump+import on databases, and imapsync on mail. The first pass is slow because nothing is in the destination yet.
  3. Cutover sync + DNS flip. Take a short maintenance window (or hot-cutover with overlap), run a delta rsync/imapsync/mysqldump to catch what’s new since pass 1, then update DNS A/AAAA records to the new Enhance app server IP. Verify each customer URL resolves to the new box and TLS provisions.
  4. Verify + sunset. For 7-14 days, keep the old cPanel account read-only (no logins, mail-forward to the new box for stragglers). After verification, delete on cPanel.

The hard parts are mail (IMAP state — read/unread, flags, folder structure — must be preserved or your customer immediately notices), DNS (TTL planning is the difference between a five-minute cutover and an hour of split-brain), and PHP version pinning (cPanel and Enhance may have different available PHP versions; a site pinned to 7.4 on cPanel may need to move to 8.1 on Enhance, which means staging the upgrade before cutover).

How to verify

Before cutover, the destination Enhance account should match the source cPanel account on five dimensions: file checksum, database schema + row counts, mail folder counts, DNS records, and TLS issuance.

# Files: checksum tree on both sides
# On cPanel
cd /home/customer1/public_html && find . -type f -print0 | sort -z | xargs -0 sha256sum > /tmp/cpanel-files.sha256

# On Enhance app server
cd /home/customers/customer1/sites/example.com/public && find . -type f -print0 | sort -z | xargs -0 sha256sum > /tmp/enhance-files.sha256

# Diff
diff /tmp/cpanel-files.sha256 /tmp/enhance-files.sha256 | head -20
# Empty means identical
-- Databases: schema + row counts
-- On both source and destination, run for each database
SELECT table_schema, table_name, table_rows
FROM information_schema.tables
WHERE table_schema = 'customer1_wp'
ORDER BY table_name;
# Mail: per-folder message count on both sides
# Source (cPanel/Dovecot)
doveadm mailbox status -u customer1@example.com 'messages' '*'

# Destination (Enhance/Dovecot)
docker exec -t enhance-dovecot doveadm mailbox status -u customer1@example.com 'messages' '*'

# Both should show the same per-folder counts
# DNS: confirm records on the new authority match
dig @ns1.enhance-dns.example.com example.com ANY +noall +answer
dig @new-enhance-ip example.com SOA +short

# TLS: should be issued by the orchestrator's ACME flow
curl -sI https://example.com/ | grep -i strict-transport
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -issuer -dates

If any of these differ, do not flip DNS. Re-sync the offending dimension first.

The fix

Phase 0 — pre-flight

Inventory the source cPanel accounts:

# On the cPanel server
ls /var/cpanel/users/ | wc -l        # total accounts
for u in $(ls /var/cpanel/users/); do
  echo -e "$u\t$(du -sh /home/$u 2>/dev/null | cut -f1)\t$(grep MAINIP /var/cpanel/users/$u | cut -d= -f2)"
done > /tmp/cpanel-inventory.tsv

Sort by size, group into waves (5-20 accounts per wave, depending on size — keep individual waves under 4 hours of total transfer time). For each wave, note which customers have high mail volume (those will dominate the transfer) and which run unusual PHP versions.

Pre-create the Plans + Packages in Enhance that match your cPanel feature lists (mailbox count, database count, disk quota, FTP user count). Bandwidth quotas usually don’t translate one-to-one — set them generously for the first 60 days, monitor actual usage, then tighten.

Phase 1 — provision destination accounts

Drive Enhance via its API. Below is a wrapper per account; loop it over the wave’s inventory file:

#!/usr/bin/env bash
# Provision one Enhance customer + first website matching a cPanel account
set -euo pipefail

ORCH="https://orchestrator.example.com"
TOKEN="<admin-bearer-token>"
APP_SERVER_ID="<destination-app-server-uuid>"
PLAN_ID="<plan-uuid>"

CUSTOMER_NAME="$1"           # e.g. "customer1"
CUSTOMER_EMAIL="$2"          # e.g. "owner@example.com"
PRIMARY_DOMAIN="$3"          # e.g. "example.com"
PHP_VERSION="$4"             # e.g. "8.1"

# 1) create customer org
ORG_ID=$(curl -fsS "${ORCH}/api/v3/customers" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d "{\"name\":\"${CUSTOMER_NAME}\",\"email\":\"${CUSTOMER_EMAIL}\",\"plan_id\":\"${PLAN_ID}\"}" \
  | jq -r '.id')

# 2) create primary website
SITE_ID=$(curl -fsS "${ORCH}/api/v3/customers/${ORG_ID}/websites" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d "{\"domain\":\"${PRIMARY_DOMAIN}\",\"app_server_id\":\"${APP_SERVER_ID}\",\"php_version\":\"${PHP_VERSION}\"}" \
  | jq -r '.id')

echo "Provisioned ${CUSTOMER_NAME} org=${ORG_ID} site=${SITE_ID}"

For each customer, also create their MySQL databases, mailboxes, and FTP/SSH users via the same API. Use Enhance’s bulk-create endpoints for accounts with many mailboxes.

Phase 2 — pre-sync

For each account, three parallel transfers:

# Files (one-way, ignoring cPanel scaffolding)
SOURCE_HOST="cpanel.example.com"
SOURCE_USER="customer1"
DEST_HOST="app-server-01.example.internal"
DEST_PATH="/home/customers/customer1/sites/example.com/public"

rsync -aHAX --numeric-ids --delete \
  --exclude '/.cpanel/' --exclude '/.cphorde/' --exclude '/.htpasswds/' \
  --exclude '/mail/' --exclude '/etc/' --exclude '/.trash/' \
  -e ssh \
  "${SOURCE_USER}@${SOURCE_HOST}:/home/${SOURCE_USER}/public_html/" \
  "${DEST_HOST}:${DEST_PATH}/"

# Databases — dump on source, stream to destination
ssh ${SOURCE_USER}@${SOURCE_HOST} \
  'mysqldump --single-transaction --quick --routines --triggers --events customer1_wp' \
  | ssh root@${DEST_HOST} \
    'docker exec -i enhance-mariadb mysql customer1_wp'

# Mail — imapsync per mailbox
imapsync \
  --host1 mail.cpanel.example.com --user1 owner@example.com --password1 'OLD_PASSWORD' \
  --host2 mail.new.example.com --user2 owner@example.com --password2 'NEW_PASSWORD' \
  --ssl1 --ssl2 \
  --regextrans2 's/INBOX\.//' \
  --no-modulesversion --useheader 'Message-Id'

Pass 1 is slow because it’s a cold transfer. Plan for 2-4 hours per 50 GB customer over a 1 Gbps link, plus mail (which has more per-message overhead and is often the slowest leg).

Lower DNS TTLs at the same time. If TTLs are at 3600 today, drop them to 300 at least 24 hours before cutover so the world has caught up by the time you flip records.

Phase 3 — cutover

For each wave, schedule a maintenance window. The minimum cutover sequence:

# 1) Final delta rsync (fast — only changed files)
rsync -aHAX --numeric-ids --delete \
  --exclude '/.cpanel/' --exclude '/mail/' \
  -e ssh \
  "${SOURCE_USER}@${SOURCE_HOST}:/home/${SOURCE_USER}/public_html/" \
  "${DEST_HOST}:${DEST_PATH}/"

# 2) Final delta DB dump
ssh ${SOURCE_USER}@${SOURCE_HOST} \
  'mysqldump --single-transaction --quick customer1_wp' \
  | ssh root@${DEST_HOST} \
    'docker exec -i enhance-mariadb mysql customer1_wp'

# 3) Final delta imapsync (incremental — quick because folders already match)
imapsync --host1 ... --host2 ... --useheader 'Message-Id' --no-modulesversion

# 4) Flip DNS — update A records to the Enhance app server IP
# If Enhance is the DNS authority, do this via API:
curl -fsS "${ORCH}/api/v3/dns/zones/${ZONE_ID}/records/${A_RECORD_ID}" \
  -X PATCH \
  -H "Authorization: Bearer ${TOKEN}" \
  -d "{\"target\":\"${DEST_PUBLIC_IP}\",\"ttl\":300}"

# 5) Verify TLS issues automatically via the panel's ACME flow
# Wait up to 5 minutes, then:
curl -sI "https://example.com/" | head -5

The cutover window per customer is normally 5-10 minutes once the pre-sync is current. The bottleneck is DNS — if your TTL is 300 seconds, plan for resolvers to take up to 5 minutes after the change, longer for clients with sticky resolvers.

For mail specifically, lower the SMTP HELO authority on the cPanel side to refuse new inbound after the cutover starts (or set up a forwarder to the new server). imapsync only handles IMAP; new SMTP delivery to the old box during the cutover window will sit on the old queue and not arrive on the new box.

Phase 4 — verify and sunset

For 7-14 days after each wave, keep the cPanel account in place but read-only:

  • Disable customer logins on cPanel (whmapi1 suspendacct user=customer1 reason="migrated-to-enhance")
  • Configure the cPanel MX record to forward to the new Enhance mail server (cPanel → Forwarders → catch-all)
  • Monitor the new Enhance app server for the customer: site uptime, mail delivery, DB connections
  • After the sunset window, run whmapi1 removeacct user=customer1 on cPanel, with the cPanel account backup retained off-box for 90 days

If anything goes wrong during the sunset window, the rollback is to revert DNS to the cPanel server’s IP (now within the 300 TTL) and unsuspend the cPanel account. We’ve used this exactly twice in years of doing this; the discipline is what makes the rollback boring.

Edge cases

  • WordPress sites with hardcoded paths in the database: wp_options.siteurl and wp_options.home, plus any plugin-stored absolute paths. Run a wp search-replace 'old.example.com' 'new.example.com' (or with --dry-run first) on the new server before customers test.
  • Custom PHP modules: cPanel installs PHP modules via easyapache. Enhance uses the panel’s PHP packages. Inventory php -m output on the cPanel side per PHP version, and request equivalent modules from Enhance support if any are missing.
  • CageFS / CloudLinux: cPanel often runs CloudLinux with per-user CageFS. Enhance has its own container-based isolation; the security posture is comparable but the per-user resource limits are configured differently — set them via the Plan in Enhance.
  • Outbound mail reputation: the new Enhance app server has a new IP. Pre-warm outbound mail by setting up SPF/DKIM/DMARC on the new IP before cutover (so customer mail authenticates from day one), and expect a short ramp where major receivers throttle until the IP is established.

Running a cPanel → Enhance wave at production scale is the kind of work migration covers under our Managed Cloud Ops wrapper — we drive the API, hold the cutover script, and own the rollback if a wave goes wrong. Scope your migration and we’ll plan the waves with you.