Migrating a cPanel server to a new host is one of the highest-risk operations a hosting company performs. Do it wrong and you get hours of downtime, corrupt databases, broken email, and angry clients. Do it right — with the correct sequence of WHM tools, DNS timing, and verification steps — and your clients never notice a thing. This guide walks through the complete cPanel-to-cPanel server migration process used by managed hosting companies worldwide.
Before You Start: The Pre-Migration Checklist
Rushing into a cPanel migration without preparation is the number one cause of downtime. Complete every item on this checklist before touching either server:
- Confirm new server specs — CPU, RAM, and disk must meet or exceed the source server. Check with
free -handdf -hon the source - Match cPanel and PHP versions — check source version:
cat /usr/local/cpanel/version. Install the same major version on the destination or accept a brief compatibility window - Note all custom PHP extensions — run
php -mon the source and replicate on destination via WHM → EasyApache 4 - Inventory all installed SSL certificates — especially AutoSSL-issued Let's Encrypt certs that will need re-issuance post-migration
- Check source server disk usage — you need at least 20% free space on both servers for temporary migration files
- Document all WHM custom configurations — MySQL my.cnf tuning, Apache limits, CSF firewall rules, cron jobs in /etc/cron.d
- Notify clients of the maintenance window — even a zero-downtime migration benefits from a 30-minute heads-up
💡 None of these worked? Skip the guesswork.
Get Expert Help →Method 1: WHM Account Transfer (Recommended for Full Server Migrations)
WHM's built-in Transfer Tool is the safest way to migrate cPanel accounts between servers. It handles file compression, database exports, DNS zone transfers, and email migration automatically.
On the destination server, generate an SSH key and copy it to the source:
ssh-keygen -t ed25519 -f /root/.ssh/migration_key -N ""
ssh-copy-id -i /root/.ssh/migration_key.pub root@SOURCE_SERVER_IP
Test the connection: ssh -i /root/.ssh/migration_key root@SOURCE_SERVER_IP "hostname"
On the destination server, go to WHM → Transfer Tool → Copy Multiple Accounts/Packages from Another Server. Enter:
- Source server IP
- Root SSH credentials or the migration key path
- Select accounts to transfer (or select all)
- Set compression to 1 (fastest) if your servers are on a fast network link
tail -f /usr/local/cpanel/logs/transfer_session/latest
Watch for Error lines. Most common issues: MySQL permission errors, accounts with very large mail directories, and symlinked directories that the transfer tool cannot handle.
# Check account exists on destination
whmapi1 listaccts | grep username
# Verify database count matches
mysql -e "SELECT schema_name FROM information_schema.schemata WHERE schema_name LIKE 'username%';"
# Check email accounts
whmapi1 list_pops_for_domains domain=example.com
rsync -avz --progress --exclude='*/tmp/*' --exclude='*/cache/*' root@SOURCE_IP:/home/username/ /home/username/
# On source server — export
mysqldump --single-transaction --routines --triggers --databases $(mysql -N -e "SHOW DATABASES LIKE 'username%';") > /tmp/username_databases.sql
# Transfer the dump
rsync -avz root@SOURCE_IP:/tmp/username_databases.sql /tmp/
# On destination — import
mysql < /tmp/username_databases.sql
# On source — export grants
mysql -N -e "SELECT CONCAT('SHOW GRANTS FOR ''', user, '''@''', host, ''';') FROM mysql.user WHERE user LIKE 'username%';" | mysql -N | sed 's/$/;/' > /tmp/username_grants.sql
# Import on destination
mysql < /tmp/username_grants.sql
mysql -e "FLUSH PRIVILEGES;"
rsync -avz --delete root@SOURCE_IP:/home/username/mail/ /home/username/mail/
The final rsync catches any messages that arrived during the migration window. Run it again 5 minutes before you change DNS — this minimises the gap.
In WHM on the source server → Exim Configuration Manager → Advanced Editor, add a router before the main local delivery router to forward mail to the new server's IP for the 24-48 hour DNS propagation window.
In your authoritative DNS, set the TTL on all A records, MX records, and CNAME records to 300 seconds (5 minutes) at least 48 hours before migration day. This means DNS changes propagate globally within 5 minutes instead of 24 hours.
# Compare file counts
ssh root@SOURCE_IP "find /home/username/public_html -type f | wc -l"
find /home/username/public_html -type f | wc -l
Update the A record for the domain and all subdomains. If using WHM's DNS cluster, update it on the nameserver directly.
Before changing DNS, test every site on the new server by adding temporary entries to your local /etc/hosts (Linux/Mac) or C:\Windows\System32\drivers\etc\hosts (Windows):
NEW_SERVER_IP example.com www.example.com
Load the site in your browser — if it works, DNS can safely be changed.
Post-Migration Verification Checklist
After DNS has propagated, run through every item before closing the migration ticket:
- All websites load correctly — test the homepage, a logged-in page, and a form submission
- SSL certificates are valid — run AutoSSL in WHM:
whmapi1 start_autossl_check_for_all_users - Email sending and receiving works — send a test email from and to each domain
- Cron jobs are running — check
crontab -l -u usernamefor each account - Database connections work — check WordPress wp-config.php, Magento env.php, etc.
- Backup is configured on the new server — confirm WHM backup is running to the correct destination
Common cPanel Migration Errors and How to Fix Them
Error: "Account restoration failed: The account already exists"
A partial transfer left a broken account on the destination. Fix:
whmapi1 removeacct user=username killdns=1
# Then re-run the transfer
Error: MySQL databases not migrating
Check if the source MySQL root password is in /root/.my.cnf and accessible by the transfer tool. If using cPanel's transfer, also check: WHM → SQL Services → phpMyAdmin for any databases owned by system users that the transfer tool skips.
Error: WordPress site shows "Error establishing database connection" after migration
The database username in wp-config.php includes the cPanel username prefix (e.g., olduser_wpdb became newuser_wpdb after the transfer). Update wp-config.php with the correct credentials from the new server's MySQL grant tables.
When to Use a Managed Migration Service
DIY cPanel migrations work well for smaller setups. For production hosting companies with SLA obligations, consider professional migration support when:
- You are moving more than 50 cPanel accounts at once
- Any account has a database over 10GB
- You need zero-downtime migration with email continuity guaranteed
- You are migrating from a non-cPanel control panel (Plesk, DirectAdmin) to cPanel
- Your clients are in regulated industries with strict data residency requirements
CloudHouse Technologies' server migration service handles the full migration lifecycle — pre-migration audit, account-by-account transfer, DNS cutover coordination, and 48-hour post-migration monitoring — for hosting companies across the US, UK, Canada, and Europe.
A successful cPanel server migration comes down to preparation, the right sequence of steps, and verifying everything before DNS changes go live. Lower your TTLs early, sync email before the cutover, and use WHM's Transfer Tool for the bulk of the work. If you are managing a large fleet of cPanel accounts or need migration support with an SLA guarantee, CloudHouse's migration specialists are available to handle the entire process for you.
