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
- DNS still points at the old server —
dig Areturns the old IP, so you are testing the old copy. The migrated site may be perfectly fine. Confirm by editing your localhostsfile to point the domain at the new IP and testing, or update theArecord / nameservers once you have verified the new copy works. Do not “fix” a site that is not actually the one you are looking at. - Wrong file ownership —
ls -lashowsrootor the old UID. Reset to the new account user: WHM » Reset Account Permissions, orchown -R <cpaneluser>:<cpaneluser> /home/<cpaneluser>. This is the top cause of a 403 immediately after a hand-done restore. - 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 inwp-config.php/.envto the new DB name, user, and password (cPanel namespaces DB names with the account prefix, so they often change). KeepDB_HOSTaslocalhostunless the DB is genuinely remote. - Hard-coded old home path —
grepfinds/home/olduser/...in a config, cron, or include path. Replace it with the new home path. Absolute paths inwp-config.php(ABSPATH), in PHPincludelines, and in cron commands are the usual offenders. - PHP version mismatch — a white screen or
Call to undefined functionafter 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. - App still has the old or temporary URL — WordPress shows the old domain or a broken
temp-urlbecausesiteurl/homeinwp_optionspoint there. Update them viawp 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. - Stale .htaccess or absolute rewrite base — a
RewriteBaseorRedirectreferencing the old path or a staging domain. Regenerate WordPress permalinks, or fix theRewriteBaseto 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.