Are you thinking to change your hosting provider and concerned how to handle the backup and restore stuff? There are many reasons you might consider a host change, could be budget or higher bandwidth. Well it is not that difficult to do so, but neither straight forward.
In today’s post, we are going to check out how to transfer a Linux based control panel (cPanel) hosted website, various cPanel accounts migration methods and best practices to transfer the content from A hosting to B hosting. Without breaking the un-breakable, lets dive in.
cPanel is an industry standard control panel software for web hosting. The reason behind it is an easy management of tasks. A friendly user interface that looks very sorted while managing your site. Before we get into the steps on how to migrate cPanel accounts, lets check out what is our objective.
We would like to share that with using the similar kind of approach, you can migrate Windows based hosting, a VPS, Ded server’s content as well. The process and terminologies could change at some extent. You might also use FileZhilla as file transfer medium, which you can install on your PC though this link here.
We could also make use of command line methods such as doing FTP, SCP, rsync through A source to B client server, but that would need extra work. Since most userbase would be having sites hosted on shared server, its better to keep it without command lines. The post would keep Linux based hosting in center, same approach could be used for other hosting, such as windows etc.
How to migrate cPanel accounts?
First of all, we would have to backup the content of all files in the cPanel account. Head over to your cPanel admin account, look for backup section or search in search bar with “backup” and tap on backup section to go to backup wizard.
Once you are in the backup section, do click on download a full account backup. This full cPanel account backup is an exact replica of all content that is present in file manager of your cPanel account.
Once you are in the section, you would get the option to select the directory, please keep home directory and enter email if you wish to get notification.
When the backup is ready, you would want to navigate to the file manager of your hosting account and download the cPanel backup. Alternatively, once can directly goto file manager and click on compress function to compress content. This compress method would be great if you are looking to have single website to migrate to other.
Its time to deploy the backup that was taken from source cPanel account and deploy it. Navigate to the directory where the backup is stored and download it. Keep it on your local machine. Login to destination cPanel account, and navigate to Backup section as in step 1. Click on choose files beneath of “Restore a Home Directory Backup”.
Click upload once chosen file is selected and it should show the snap as below. Please be patient while it run in background like this which can take 10 to 30 minutes depending upon your content.
Now there is a chance that it might error out on your end, like Directory restoration “failed to fetch” or Error: SyntaxError: Unexpected token ‘<‘, ” <!DOCTYPE “… is not valid JSON. If you get such errors, still navigate to file manager as you might see the content there.
If you didn’t get the expected results, please upload and decompress through file-manager itself. Lets say, its the root enabled server you are using source account in, you might want to look out for a error logs to review why this is happening.
You may run (
/usr/local/cpanel/logs/error_log | tail -10 ) to get to know the error in details if you have server with root permissions. You may also make use of FileZhilla to transfer the tar ball (tar.gz) files to your destination server, and for that you would need a FTP account. Please navigate to FTP account through cPanel admin on your destination account and create one. You may use it by following steps here.
Once the deployment is properly done, you can navigate to the directory under file manager and look for homedir directory to locate the main site files. You may also look for mysql directory to deploy databases later.
Once the files are set to the right directory, its now time to deploy the database if your site uses it. You would need to navigate to cPanel admin> MySQL@Databases and create a database. Then you would need to follow the import steps here.
Since we have migrated the content, we would also need to update the username of cPanel in all required places. Generally that is done in configuration file such as if it is WordPress website, you would goto wp-config.php file and update the right database connection strings. Do also make sure, that the domain name is pointed to your new hosting IP as sometimes I have seen many user make that mistake.
If all steps followed thoroughly, we believe the site should load finely. You can get rid of the other server you migrated content from. It is always a good approach to keep a local backup of the copy which would save you from many paid scenario.
We have seen, how to migrate the cPanel account from A server to B server. Transferring the content this way would reduce costing of migration and also you can utilize same approach to migrate plesk accounts. You can even migrate cPanel emails this way. If you were able to migrate it this way, do comment in the section below. Also, if you get any issues in migration or need help, do fill up the form here and we will get back to you in 3 hours. This concludes about the cPanel account migration, have a great day ahead.