Skip to content

Site broken after a cPanel migration or account restore: the usual breakages

A site that worked on the old server is broken right after a cPanel transfer or restore. The files moved but paths, permissions, and config did not follow. Here is the checklist.

A site that ran fine on the old server and is broken the moment it lands on a new cPanel host has a small, predictable set of causes. The files copied over, but the things bound to the old environment did not follow: hard-coded paths in config, the database connection, file ownership, the PHP version, and the URLs stored inside the application. Each one fails in a recognizable way, so the fix is to walk the same short list every time rather than treat each migration as a mystery.

What’s happening

A cPanel transfer or restore moves the account’s files and databases, but several things are environment-specific and do not travel cleanly. The home path may change (old /home/olduser, new /home/newuser), so any absolute path baked into a config file (wp-config.php, framework .env, a cron command) now points at a directory that does not exist. The database is restored but the app’s stored credentials, or the DB hostname, may differ — a localhost that worked before still works, but a hard-coded old hostname does not. File ownership can land as root or the old UID if the restore was done by hand, which suEXEC then refuses (a 403). The PHP version on the new box may differ, surfacing as a white screen or fatal. And applications that store their own URL — WordPress (siteurl/home), most CMSes — keep pointing at the old domain or the temporary URL used during testing.

The other classic is testing too early: the site is “broken” only because DNS still points at the old server, so you are looking at the old copy, not the migrated one.

How to verify

Confirm you are actually hitting the new server, then read the error log for the specific fault.

# Are you looking at the new server or the old one?
dig +short A example.com
hostname -I          # run on the NEW server — do the IPs match?

# The error log names the real failure
tail -50 /home/<cpaneluser>/logs/<domain>.error.log
tail -50 /usr/local/apache/logs/error_log

Check ownership, the PHP version, and any path baked into config.

# Ownership should be the NEW cPanel user, not root or the old UID
ls -la /home/<cpaneluser>/public_html/ | head

# Which PHP version is the account on now?
grep -i "<domain>" /etc/userdatadomains

# Hunt for old absolute paths and DB settings in app config
grep -rniE 'olduser|/home/[a-z0-9]+/|DB_HOST|DB_PASSWORD' /home/<cpaneluser>/public_html/wp-config.php
grep -rni 'localhost\|DB_' /home/<cpaneluser>/public_html/.env 2>/dev/null

Confirm the database actually restored and the app can reach it:

# Does the database exist and have tables?
mysql -e "SHOW DATABASES;" | grep <dbname>
mysql <dbname> -e "SHOW TABLES;" | head

# WordPress: what URL does the DB think the site lives at?
mysql <dbname> -e "SELECT option_name,option_value FROM wp_options WHERE option_name IN ('siteurl','home');"

The fix

  1. DNS still points at the old server — dig A returns the old IP, so you are testing the old copy. The migrated site may be perfectly fine. Confirm by editing your local hosts file to point the domain at the new IP and testing, or update the A record / nameservers once you have verified the new copy works. Do not “fix” a site that is not actually the one you are looking at.
  2. Wrong file ownership — ls -la shows root or the old UID. Reset to the new account user: WHM » Reset Account Permissions, or chown -R <cpaneluser>:<cpaneluser> /home/<cpaneluser>. This is the top cause of a 403 immediately after a hand-done restore.
  3. Database not connected — the log or page shows a DB connection error. Confirm the database and user exist (SHOW DATABASES), then update the app’s stored credentials in wp-config.php / .env to the new DB name, user, and password (cPanel namespaces DB names with the account prefix, so they often change). Keep DB_HOST as localhost unless the DB is genuinely remote.
  4. Hard-coded old home path — grep finds /home/olduser/... in a config, cron, or include path. Replace it with the new home path. Absolute paths in wp-config.php (ABSPATH), in PHP include lines, and in cron commands are the usual offenders.
  5. PHP version mismatch — a white screen or Call to undefined function after the move. Set the account to the PHP version the app expects in cPanel » MultiPHP Manager and enable any extensions it needs (Select PHP Version » Extensions). See the white-screen and 500 runbooks for surfacing the exact fatal.
  6. App still has the old or temporary URL — WordPress shows the old domain or a broken temp-url because siteurl/home in wp_options point there. Update them via wp search-replace (WP-CLI) or directly in the database, then clear any object/page cache. CMSes with a stored base URL need the same correction.
  7. Stale .htaccess or absolute rewrite base — a RewriteBase or Redirect referencing the old path or a staging domain. Regenerate WordPress permalinks, or fix the RewriteBase to match the new docroot (see the .htaccess and 404 runbooks).

Once ownership, the database, paths, the PHP version, and the stored URL all match the new environment, load the site against the new server’s IP and confirm a clean 200 in the access log with no errors logged — verifying against the new IP (not stale DNS) is what proves the migration itself is sound. Stack Harbor handles cPanel post-migration triage under cPanel/WHM management — start a conversation.