Moving a WordPress site off cPanel to a destination that has never heard of cPanel is two jobs, and most handoffs only do the first. Job one is the site: files and database, exported so they restore with identical row counts and no broken serialised data. Job two is the manifest — the cron entries, mail routing, DNS records, PHP overrides, ModSecurity exceptions, certificate coverage, document roots and login accounts that were configured in the cPanel interface and exist nowhere inside the export. Job one takes an hour. Job two is the difference between a clean off-board and three weeks of “can you also send us the…”. This guide covers both, then the cutover order and the safe teardown of the source account. If you are moving the other direction — into cPanel — the WP Engine runbook is the guide you want instead.
What you’ll accomplish
- A verified export pair — one files archive, one database dump — with checksums the receiving party can confirm before they start.
- A written manifest of every setting that lived in cPanel and has to be rebuilt by hand at the destination.
- A rehearsal restore that proves the export works before the write freeze, so the live window is minutes, not hours.
- A cutover order that moves the site first and mail second, with routing decided rather than discovered.
- A source account you suspend, keep as a rollback for a week, then terminate on a date you chose.
Prerequisites
Shell access changes this job considerably. With SSH you can dump the database properly, checksum the archives, and finish in an afternoon. With cPanel-only access you are working through File Manager, phpMyAdmin and the Backup interface, and the database export becomes the weak link. Ask your host to enable SSH first; it is usually a support ticket, not a plan change.
Assume WordPress 6.x, PHP 8.1 or newer, and MySQL 5.7 or MariaDB 10.4 and up. WP-CLI is normally installed as wp on cPanel servers — check with wp --info. If it is missing, mysqldump alone will do the database work.
You also need two answers from the destination before exporting anything: which PHP version it will run, and whether it will host mail. Both change what goes in the manifest and shape the cutover order.
How it works
A cPanel full backup produces a cpmove-<user>.tar.gz archive containing far more than the site: the home directory, database dumps and grant statements, DNS zone files, mail aliases and filters, cron lines, per-domain userdata, and installed SSL certificates. That is a complete account. The catch is the format — everything outside the home directory is laid out the way WHM’s restore process expects, so only a cPanel or WHM server can consume it. Hand that archive to a Kubernetes platform, a managed WordPress host or a plain Nginx VPS and it is an opaque tarball somebody has to excavate.
So the export splits into two halves that behave very differently.
The left half — files and database — is portable anywhere. The right half is configuration state, invisible from inside WordPress. Nothing in wp-content/ knows that a cron line runs wp cron event run --due-now every five minutes, that the domain is a remote mail exchanger, that ModSecurity rule 941100 is disabled for the checkout URL, or that an addon domain’s document root is /home/<user>/shop. The receiving party cannot infer any of it, and if you do not write it down they discover each item one production incident at a time.
Two of those items cause more grief than the rest combined. Mail: if the cPanel server has been the mail exchanger, the mailboxes are real data no site export touches, and delivery follows DNS the moment it moves. Document roots: subdomains and addon domains can point anywhere in the home directory, so an export that assumes public_html is the whole site quietly leaves half of it behind.
Step-by-step
Steps 1 to 4 are rehearsal and repeatable. From step 5 the site is frozen and the clock is running.
-
Map what the account actually serves. Before assuming
public_htmlis the site, list every domain and its document root.uapi DomainInfo list_domains ls -la ~/public_html/ | grep '^l'The first prints the main domain, addon domains, subdomains and parked domains as separate lists. The second returns nothing on a normal account — every line it does return is a symlink pointing somewhere your archive will not follow. Note both results; they go in the manifest.
-
Record the version baseline. The destination has to match this or the site will fail in ways that look like corrupt files.
wp core version wp plugin list --fields=name,version,status wp theme list --fields=name,version,status wp db prefix php -vExpect a WordPress version string, two tables of extensions each carrying an
activeorinactivestatus, a table prefix — often notwp_— and a PHP version line. That prefix is the most commonly missed item: a destination that assumeswp_imports fine and then shows an empty site. -
Capture the cPanel-only configuration into the manifest. These are read from the account, not from WordPress.
crontab -l uapi Email list_pops uapi Email list_forwarders uapi Ftp list_ftp uapi SSL installed_hosts uapi LangPHP php_get_vhost_versions dig +noall +answer example.com A example.com MX example.com TXT www.example.com CNAMEEach
uapicall returns YAML with aresult: 1line;crontab -landdigreturn plain text. Paste all of it verbatim intomigration-manifest.md— do not summarise. Ifcrontab -lreports no crontab, write that down rather than leaving the section blank, because blank reads as “not checked”. Add the PHP overrides by hand:cat ~/public_html/.user.ini grep -rn 'php_value\|php_flag' ~/public_html/.htaccess.user.iniis where cPanel’s MultiPHP INI Editor writes per-account limits under PHP-FPM. A “No such file” result means the account runs stock values, which is itself worth recording. -
Note what only WHM can see. If you have root, three more items belong in the manifest — the per-domain PHP-FPM pool values, any ModSecurity exceptions, and the account’s own metadata.
cat /var/cpanel/userdata/<user>/<domain>.php-fpm.yaml grep -rn 'SecRuleRemoveById\|SecRuleEngine' /etc/apache2/conf.d/userdata/std/2_4/<user>/ grep -x 'example.com' /etc/localdomains /etc/remotedomainsThe FPM file lists
pm_max_childrenand friends. Thegrepover the Apache userdata tree returns every ModSecurity rule ID somebody disabled here — each one stands for a real request that was being blocked, and each has to be recreated at the destination or that request starts failing again. The last command says whether cPanel treats the domain as a local or remote mail exchanger, which decides the mail half of the cutover. Without root, ask the host for these three. -
Freeze writes. Put the site into maintenance mode, stop order processing, and tell whoever owns the store. Everything after this point assumes the database has stopped changing. Skipping the freeze is what produces a destination that is missing the last few hours of orders.
-
Export the database with the right options, not through phpMyAdmin. phpMyAdmin times out well before a real production database finishes, and it fails silently often enough that you cannot trust a file it produced.
mkdir -p ~/export wp db export ~/export/site-db.sql --single-transaction --quick --default-character-set=utf8mb4 --add-drop-table --no-tablespacesSuccess prints
Success: Exported to '/home/<user>/export/site-db.sql'. Without WP-CLI the same options apply tomysqldumpdirectly, plus--routines --triggersif the site uses either.--single-transactionavoids locking a live InnoDB site;--quickstreams rows instead of buffering the result;--default-character-set=utf8mb4keeps emoji and accented characters from arriving as mojibake. Confirm the dump is complete before trusting it:tail -3 ~/export/site-db.sql grep -c 'CREATE TABLE' ~/export/site-db.sqlThe tail must end on a comment block, never mid-
INSERT. A truncated dump imports without an error and loses the tail of your largest table. -
Export the files, excluding what regenerates. Caches rebuild at the destination and only inflate the transfer.
tar --exclude='wp-content/cache' --exclude='wp-content/uploads/cache' \ --exclude='wp-content/upgrade' --exclude='.git' \ -czf ~/export/site-files.tar.gz -C ~/public_html . du -sh ~/export/site-files.tar.gzCompare that size against
du -sh ~/public_html/— a compressed archive that is a tiny fraction of the source usually meanstarhit a permission error and kept going. If step 1 found addon domains outsidepublic_html, archive each of those directories too and name them in the manifest. -
Checksum, then hand over. The receiving party needs to know their download is intact before they spend an hour on a corrupted file.
sha256sum ~/export/site-files.tar.gz ~/export/site-db.sql > ~/export/SHA256SUMS cat ~/export/SHA256SUMSTransfer over SFTP with key authentication or a short-expiry signed link — never an email attachment, and never a public URL under
public_html. Strip the database credentials out ofwp-config.phpfirst and record them in the manifest instead; the destination writes its own file anyway, and the old salts should not survive the move. -
Switch DNS, then mail — in that order. Once the destination renders correctly, point the A and AAAA records at it. Leave MX alone until mailboxes actually exist on the receiving side. If cPanel has been the mail host, that means provisioning mailboxes elsewhere and moving the messages before MX changes, not after.
-
Suspend the source account rather than deleting it. In WHM, use Account Functions and suspend. Files, database and mail stay on disk while the account stops serving — exactly the rollback you want for the first week. Terminate on a date you write down, once the destination has run a full week including its weekly scheduled jobs.
Validate it works
The only real validation is a restore somewhere other than the source. Do it during the rehearsal — a spare host or a local container is fine — and compare against the live site.
wp db query 'CHECKSUM TABLE wp_posts, wp_postmeta, wp_options, wp_users;'
wp db query 'SELECT COUNT(*) FROM wp_posts;' --skip-column-names
wp core verify-checksums
wp option get siteurl
Run the first two on both the source and the restored copy: CHECKSUM TABLE returns one line per table and the values must match exactly on both sides. Substitute your real table prefix from step 2. verify-checksums should report success — anything it flags did not transfer cleanly. siteurl should still be the original domain at this stage, because you have not run search-replace yet.
Then prove the site renders and that serialised data survived:
wp search-replace 'https://old.example.com' 'https://new.example.com' --all-tables --dry-run --report-changed-only
curl -sI --resolve example.com:443:203.0.113.10 https://example.com/ | head -5
The dry run prints a table of counts and a Success: N replacements to be made line — read those counts, because a widget or page builder storing URLs inside serialised arrays shows up there and nowhere else. The curl should return 200 from the destination IP; a certificate mismatch here is expected. Finally walk it in a browser: admin login, a page with an inline image, one instance of every custom post type, and checkout if the site sells anything.
Troubleshooting
Widgets, theme options or page-builder layouts come back empty. Somebody ran a raw UPDATE ... REPLACE() against the database instead of wp search-replace. PHP serialised strings carry their own byte length, so changing a URL inside one without updating the prefix makes the whole structure unreadable and WordPress discards it silently. Restore from the dump and redo it with WP-CLI — the serialised search-replace runbook explains exactly what breaks. The WP-CLI command reference documents the flags.
Half the media library 404s at the destination. The uploads directory was a symlink to somewhere outside public_html, or the site was an addon domain whose document root is elsewhere in the home directory. Step 1 catches both. Re-archive the real path, and check wp option get upload_path in case an older install has an absolute path stored — /home/<olduser>/public_html/wp-content/uploads is meaningless on the new host and has to be blanked.
The database imports but WordPress cannot log in or write. The dump carries table data, not grants. cPanel database users are prefixed with the account name and do not exist on the destination, so the receiving side must create their own user and grant it on their own database. Put the old credentials in the manifest for reference only.
Mail keeps arriving at the old server after DNS moves. Either only the A record was updated and MX still points at cPanel, or the domain is still listed in /etc/localdomains on a box that handles other domains, so Exim keeps accepting for it. Check dig +short MX example.com from outside, and confirm the messages themselves were migrated — DNS moves routing, not mailboxes.
Fatal errors mentioning a path under /home/. A plugin or a hardcoded define in wp-config.php stored an absolute cPanel path — a cache directory, a log file, an autoloader include. Grep before handing over: grep -rn '/home/' ~/public_html/wp-config.php ~/public_html/wp-content/*.php finds most of them, and the rest surface the moment the destination has a different home directory layout.
When this is the wrong approach
If the destination is another cPanel or WHM server, stop and use the account transfer instead. WHM’s Transfer Tool or a full backup restore moves the mail, cron, DNS zone, document roots, PHP version and certificates in one operation, and doing it by hand throws that away for no benefit. The manifest approach exists precisely because the receiving platform cannot read a cpmove archive. cPanel’s documentation portal covers the transfer options. Plesk is a similar case: it has a supported cPanel import that carries far more of the account than a tarball does.
And if the reason for leaving is that cPanel felt slow, the export will not fix it. A site that is slow because of an unindexed wp_options table or a plugin making uncached remote calls will be exactly as slow on Kubernetes, with a larger bill and a smaller support surface. Measure first; move for a reason you can name.
Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.