Skip to content

Migrating WordPress to cPanel from a generic shared host

A practical path for migrating WordPress from a generic shared host (Bluehost, HostGator, Namecheap, OVH, and similar) into a cPanel account — checklist, gotchas, and verification.

Most “generic shared host” migrations into cPanel are easier than the managed-host migrations because the source is usually cPanel-on-cPanel. The trap is assuming sameness everywhere. PHP versions drift, MySQL variants differ, the source might be on Apache while the target is LiteSpeed, and the rewrites that worked there silently behave differently here.

What’s happening

The source host typically gives you cPanel access (full backup option), SFTP access (files manually), or phpMyAdmin (database). The cleanest path is to use cPanel’s “Backup Wizard” on the source if available — it produces a single archive you can restore on the cPanel target with one operation. When the source predates that option, you’re back to manual files + SQL dump.

How to verify

On the source, before starting:

php -v
mysql --version
ls -la public_html/ | head
du -sh public_html/
wp option get siteurl 2>/dev/null

Note the PHP version, MySQL version, and total disk used. The cPanel target needs at least the same PHP version (or the site will break) and enough disk to fit the source plus working space.

The fix

  1. On the source, take a full cPanel backup if available: cPanel > Backup > Generate Full Backup. Email when ready, or download via SFTP. The archive includes files, databases, email, DNS, cron, addon domains, and FTP accounts.

  2. On the target cPanel server (as root or via WHM > Transfer Tool), restore the archive: whmapi1 restoreaccount file=cpmove-username.tar.gz. WHM also has a “Restore a Full Backup/cpmove File” interface that wraps the same API. This is the fastest path and the one we use when both sides are cPanel.

  3. If a full backup isn’t available, do it manually:

    • Files: SFTP public_html/ and any other web roots to the target account home. Restore preserving permissions.
    • Database: mysqldump -u $DBUSER -p $DBNAME > dump.sql on source; mysql -u $TARGETUSER -p $TARGETDB < dump.sql on target.
    • Email: if hosted on the source, plan separately — IMAPSync or migrate to a dedicated mail platform.
  4. Write wp-config.php for the target. Even if the source one works, replace it. Different DB credentials, new salts, hardening constants. Check the table prefix matches the import — many old shared hosts ship with wp_; if you change it, you change it in the database too.

  5. Search-replace the siteurl if anything changed (most migrations don’t change the domain at this stage, but staging URLs in plugin options often need cleanup):

    wp search-replace 'old-staging.example.com' 'example.com' --all-tables
  6. Adjust .htaccess for Apache vs. LiteSpeed. LiteSpeed honors Apache’s .htaccess for most rules but has its own caching directives. If the source had a custom mod_rewrite block for HTTPS or caching, audit it under LiteSpeed before relying on it.

  7. PHP version test. If the source ran 7.4 and the target defaults to 8.2, run wp plugin verify-checksums --all and wp theme verify-checksums --all, then browse the site under PHP 8.2. Anything that throws on the deprecated constructs gets fixed before cutover.

For environments where this migration is part of a larger consolidation, Stack Harbor runs it under migration.

Stack Harbor operates production WordPress at scale — see enterprise WordPress operations for the managed model, or book a WordPress consult for a written read of your current shape.