Full Disaster Recovery Guide for cPanel & WHM Servers

This guide provides a complete disaster recovery procedure for cPanel & WHM servers after a hard‑drive crash or system failure. It covers preparation steps, rebuilding the server, provisioning a new drive, recovering data through chroot, backing up accounts and configurations, restoring files to a new system, and validating the recovered server.

cPanel disaster recoveryserver crash restorationcPanel chroot recovery

~4 min read · Updated Feb 18, 2026

1. Overview


Warning: Only experienced system administrators should perform full disaster recovery. WebPros International, LLC does not support failed hard drives or data recovery and is not responsible for data loss.


In cases where your server’s hard drive fails or becomes unbootable, you may need to fully rebuild and restore your cPanel & WHM server.


2. Prepare to Restore Your Server


If you have recent remote backups and cannot boot the failed drive, you can proceed directly to rebuilding the server.


Warning: If you lack recent remote backups, revise your backup strategy to ensure regular off‑server backups.


If the failed drive is still bootable:


  • If WHM is accessible, create a backup via Backup Configuration.
  • If WHM is not accessible, run:
    /usr/local/cpanel/scripts/pkgacct

Transfer all backup files to a remote location before proceeding.


3. Rebuild the Server


Some hosting providers offer automated restoration or imaging. Contact your provider for available options.


Important: The replacement server must use identical software versions—MySQL/MariaDB, PHP, Apache, and extensions. Mismatched versions may cause severe errors.


Perform updates only after the restoration is complete.


4. Manually Provision a New Hard Drive


Important: Only use official OS ISO images. Third‑party images may cause system issues.


Steps:


  1. Install a new primary hard drive and attach the old drive as secondary.
  2. Install the operating system.
  3. Install cPanel & WHM:
    cd /home
    curl -o latest -L https://securedownloads.cpanel.net/latest
    sh latest

5. Request a New Drive and Image


If your provider installs a new drive and attaches the old one as secondary, update cPanel using:


/usr/local/cpanel/scripts/upcp

Or via WHM’s Upgrade to Latest Version interface.


6. Recover Your Files


If you cannot boot the failed drive and lack remote backups, proceed with file recovery.


Steps to recover data using chroot:


6.1 Mount the secondary drive


mkdir /mnt/chroot/
mount /dev/sdb1 /mnt/chroot/

6.2 Bind mount system filesystems


mount --bind /proc /mnt/chroot/proc
mount --rbind /dev /mnt/chroot/dev
mount --bind /sys /mnt/chroot/sys

6.3 Verify mounts


grep chroot /etc/mtab

6.4 Start a tmux session


tmux

6.5 Enter the chroot environment


chroot /mnt/chroot /bin/bash -l
export PS1="{chrooted}$PS1"

6.6 Load environment


source /etc/environment && source /etc/profile

6.7 Start required services


Start MySQL:

/usr/sbin/mysqld --daemonize --user=mysql --pid-file=/var/run/mysqld/mysqld.pid ${MYSQLD_OPTS}

Start dnsadmin:

/usr/local/cpanel/libexec/dnsadmin-startup --start

6.8 Back up accounts


cd /var/cpanel/users
for i in `ls -1 *`; do /scripts/pkgacct --skipdnszones $i; done

Warning: Do not use rsync to back up accounts.


6.9 Back up service configurations


cd /usr/local/cpanel
bin/cpconftool --modules=cpanel::smtp::exim,cpanel::system::backups,cpanel::system::mysql,cpanel::system::whmconf,cpanel::easy::apache,cpanel::ui::themes --backup

6.10 Transfer backups to remote storage


Use scp or rsync to copy files to a safe location.


6.11 Stop services and unmount


service mysql stop
umount {/proc,/dev,/sys}
exit

7. Restore Files to the New Server


7.1 Transfer backups to the new server


Use scp or rsync.


7.2 Restore feature lists


cd /backups
tar -xzvf _var_cpanel.tar.gz var/cpanel/features

7.3 Restore accounts


cd BACKUPDIRECTORY/TYPE/DATE/accounts/
for archive in `ls`; do /scripts/restorepkg $archive; done

7.4 Restore configuration settings


/usr/local/cpanel/bin/cpconftool --restore

7.5 Restore CloudLinux settings (if applicable)


8. Test the Server


Verify websites, applications, email, and all services to ensure the restoration is complete and functional.


9. Reconnect to a tmux Session


tmux ls
tmux a -t example

Conclusion


This disaster recovery process ensures that you can rebuild and restore a cPanel & WHM server after catastrophic hard‑drive failure. Following these steps carefully helps preserve data integrity and restore full service functionality.


Written & researched by Dr. Shahin Siami

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue