I hope this topic will be helpful for all of you..
You have a server whose disk is crashed for some reason and you have been provided with a new disk with OS and cPanel installed on it (SDA). The old drive is attached to the disk and this will be the second disk on the server (SDB)
Check what partition contained the data through below command:
Code:
[FONT=georgia][SIZE=16px][FONT=comic sans ms][FONT=comic sans ms]# fdisk -l[/FONT][/FONT][/SIZE][/FONT]
Code:
[FONT=comic sans ms][SIZE=16px]# mkdir /old_drive # mount /dev/hdb3 /old_drive[/SIZE][/FONT]
Code:
[FONT=comic sans ms][SIZE=16px]# ls /old_drive/home[/SIZE][/FONT]
Code:
[FONT=comic sans ms][SIZE=16px]# rsync -vrplogDtH /old_drive/usr/local/apache/conf /usr/local/apache # rsync -vrplogDtH /old_drive/var/named /var # rsync -vrplogDtH /old_drive/usr/local/cpanel /usr/local # rsync -vrplogDtH /old_drive/var/cpanel /var # rsync -vrplogDtH /old_drive/usr/share/ssl /usr/share # rsync -vrplogDtH /old_drive/var/ssl /var # rsync -vrplogDtH /old_drive/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty # rsync -vrplogDtH /old_drive/var/log/bandwidth /var/log # rsync -vrplogDtH /old_drive/usr/local/frontpage /usr/local # rsync -vrplogDtH /old_drive/var/spool/cron /var/spool # rsync -vrplogDtH /old_drive/root/.my.cnf /root # rsync -vrplogDtH /old_drive/etc/httpd/conf/httpd.conf /etc/httpd/conf[/SIZE][/FONT]
Copy the MySQL data and then home data.. These are usually large in size, so my preferred choice is to do that in the last:
Code:
[FONT=comic sans ms][SIZE=16px]# rsync -vrplogDtH /old_drive/var/lib/mysql /var/lib # rsync -vrplogDtH /old_drive/home/* /home[/SIZE][/FONT]
Code:
[FONT=comic sans ms][SIZE=16px]# cd /old_drive/etc # rsync -vrplogDtH 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[/SIZE][/FONT]
Code:
[FONT=comic sans ms][SIZE=16px]# passwd root[/SIZE][/FONT]
Code:
[FONT=comic sans ms][SIZE=16px]# /scripts/upcp[/SIZE][/FONT]
Once this is complete, the recovery is done. At this time, a reboot may not be required, but if there is any kernel update, please do install it and reboot the machine once.
I hope that has been informative for you and I would like to thank you for viewing it.