Recover data from a crashed cPanel server

[Total: 8    Average: 5/5]

This article will guide you through the necessary steps to restore your data from a previous cPanel environment that is no longer functional. Sometimes operating system or hard drive crashes and makes your system un-bootable. You can install OS on a new hard disk and mount your crashed disk as secondary drive with help your data centre. Install cPanel on it and mount the old hard disk.

Recover data from a crashed cPanel server

Mount the old hard disk

mkdir /mnt/olddrive
mount /dev/sdb1 /mnt/olddrive

Rsync all the data from crashed disk to new disk.


rsync -avHz /mnt/olddrive/usr/local/apache/conf /usr/local/apache
rsync -avHz /mnt/olddrive/var/named /var
rsync -avHz /mnt/olddrive/home/* /home
rsync -avHz /mnt/olddrive/usr/local/cpanel /usr/local
rsync -avHz /mnt/olddrive/var/lib/mysql /var/lib
rsync -avHz /mnt/olddrive/var/cpanel /var
rsync -avHz /mnt/olddrive/usr/share/ssl /usr/share
rsync -avHz /mnt/olddrive/var/ssl /var
rsync -avHz /mnt/olddrive/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
rsync -avHz /mnt/olddrive/var/log/bandwidth /var/log
rsync -avHz /mnt/olddrive/usr/local/frontpage /usr/local
rsync -avHz /mnt/olddrive/var/spool/cron /var/spool
rsync -avHz /mnt/olddrive/root/.my.cnf /root
rsync -avHz /mnt/olddrive/etc/httpd/conf/httpd.conf /etc/httpd/conf

Rsync the configuration files from crashed disk to new disk

rsync -avHz secondarymx domainalias valiases vfilters exim* proftpd* pure-ftpd* passwd* group* *domain* *named* wwwacct.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddrpool* ssl hosts /etc

Update the cPanel and Apache

/scripts/upcp --force
/scrtips/easyapache --force

Restart all the services

/scripts/mysqlup --force
/etc/init.d/cpanel restart
/scripts/restartsrv_exim
/scripts/restartsrv_named
/scripts/restartsrv httpd