Skip to content

Disaster recovery when you lose the whole cPanel host

Losing the entire cPanel host is recoverable if backups exist and you know the order to restore in. The order matters more than people realize.

The cPanel host is unreachable, the provider confirms hardware failure, and the team is staring at a fresh server with a cPanel license and nothing else. Recovery is possible if backups exist — but the order of restore decides whether the team finishes in four hours or four days. Restoring accounts before DNS, mail before files, or AutoSSL before mail routing each create a different failure that costs hours to unwind.

What’s happening

A cPanel host owns a stack: OS configuration, WHM settings, packages, ACLs, reseller hierarchy, IP assignments, DNS authority, the account list, individual account contents, AutoSSL state, and Exim configuration. Restore order matters because a partially-restored host serves wrong answers — mail rejected from a domain that has not yet been added to /etc/localdomains, certs that fail to issue because DNS does not yet point at the new IP, accounts that conflict with each other because resellers were not restored first.

How to verify

Inventory what is available before touching the new host:

# from a workstation
dig +short SOA example.com @<original-ns>
dig +short MX example.com @<original-ns>
# in the backup store
ls /backup/cpanel/<date>/accounts/
ls /backup/cpanel/<date>/*.tar.gz

On the new host, confirm baseline:

/usr/local/cpanel/cpanel -V
whmapi1 get_license_info
whmapi1 listips

The fix

  1. WHM-level configuration first — restore /etc/wwwacct.conf, /var/cpanel/packages/, /var/cpanel/resellers, /var/cpanel/users/ from backup. Without these, account restores will fail.
  2. DNS authority — restore /var/named/ zones, add the new server to the DNS cluster, and update glue records at the registrar if hostnames moved. Mail will not route correctly until DNS is authoritative.
  3. Account restore in waves — /scripts/restorepkg <account>.tar.gz for the largest 10 accounts first; verify each before moving on. Resellers must be restored before their children.
  4. Mail routing — verify /etc/localdomains and /etc/remotedomains are consistent with the restored zones. exim -bt for one account per domain.
  5. AutoSSL last — only after DNS is authoritative and mail is routing. Run whmapi1 start_autossl_check_for_all_users. AutoSSL needs HTTP-01 to reach the new IP, which requires steps 1–4 done.

If the backup is older than 24 hours, write down what was likely lost and communicate it before users discover it. Stack Harbor runs full-host recovery under migration solutions — start a conversation before the restore order is finalized.