How to Transfer WHM/cPanel to another hard drive

Hopefully most of you knew from the Facebook and Twitter pages that I had a corrupt hard drive and had to exchange out the hard drive with a new one. I ended up purchasing an industrial SSD instead of the old Cheetah drive. Life is longer and the speeds are greater with these solid state hard drives. So I thought I would write a tutorial on how to do this process.

There was 1 tutorial I found on another website that said he was in the same predicament, but gave VERY bad instructions. He said to copy over your configuration files and re-run the scripts given by the cPanel team. The MAJOR issue here is that if you do that, all your permissions will be incorrect, even after running the scripts! This could cause serious issues down the road, so let’s just do this step by step and do this the right way.

STEP 1) Try to use Clonezilla to clone from HDD to HDD. If it clones successfully, then you are done! But, if you have bad sectors and this fails, you will have to continue the tutorial.

STEP 2) Use an external hard drive to back up your files. You can either hook it up to the Linux server and do a mount command then proceed to back up the public_html folders. Otherwise hook this in to a windows computer and use FTP to transfer the files out. If you choose to use linux, you may need to change the file permissions when transferring them back.

STEP 3) Back up the SQL data. Use the phpmyadmin software to export each table, or any other 3rd party MySQL utility.


STEP 4) Use cPanel to keep note of any and all email addresses, cron jobs you need to recreate. Use WHM to keep note of all accounts.

STEP 5) Install the new WHM/cPanel OS and software on the new hard drive. Keep the old one aside encase you need to return to it.

STEP 6) Create the accounts again in WHM. Restore the public_html files using FTP. If you choose to re-mount the USB drive right on the server itself, you will have to ensure the permissions are correct using the “chown USER:USER /public_html -R” command. Where USER is the account name.

STEP 7) Create the SQL users and tables in the MySQL utility in cPanel. Use phpmyadmin or another 3rd party MySQL utility to import the table data.

STEP 8) Recreate the email addresses and cron jobs.