Web Hosting Tips

How to Migrate a cPanel Between Hosts

By December 28, 2016 No Comments

If you need to replace your server, it is important that you follow the proper steps to migrate your cPanel in order to prevent damaging the configuration of your new web hosting account. Once you migrate your cPanel, your website, database, and email accounts will be transferred to your new host. Though the process only takes about an hour, there are many steps that you will need to follow in order to transfer everything properly.

To help you seamlessly migrate a cPanel between hosts, we have compiled the following important steps:

  1. Backup your home directory

Go into your file management directory and click the home directory. You will then need to select the files that you would like to transfer to your new host. Many choose to move their “public_html” directory as this is where most of your site’s files are stored. Once the directory is selected, click “compress” to a zip archive file. Allow it to download.

Note: if you have subdomains you will need to repeat this step for each.

  1. Use the backup wizard to backup your MySQL database

Using the backup wizard select the MySQL database that you would like to backup and hit download.

  1. Restore your MySQL database on your new host account

Using the backup wizard on your new hosting account, hit “restore” and click on “MySQL databases”. On the next page, click “choose file” and select the MySQL database file that you downloaded from your old host and click upload.

Once the upload is complete you can return to home and enter “MySQL databases” again in order to confirm that it transferred properly. The name of your database will likely change because you will have a new home directory name.

  1. Add a new user to your MySQL database

You will need to create a new username and password to add to your MySQL database (unless your new host will allow you to keep the same name that you had). Add the new user to the database and select “all privileges” on the next page so that you can be the administrator.

  1. Restore your files

Go back to home and select “file manager” > “home directory”. Make sure you select “show hidden files”. Go to the “public_html” directory and upload the zip file of the old public_html file that you downloaded from your old host. Once uploaded you can extract the files from the zip folder.

Note: You cannot simply upload the file in the home directory because by doing so, you will overwrite your “public_html” directory and this could accidentally overwrite important configuration or files that are necessary to the server. However, if you have subdomain directories, these can be uploaded in the home directory.

  1. Move files to the home “public_html” directory

Once the files are unzipped, you can select them all and copy them over to the “public_html” directory folder in the home directory.

Note: the path should look like /public_html

  1. Change your configurations if necessary

At this point, you can try to go to your site and see if it loads. If so, you will not need to make any more changes, just make sure that your folder permissions are set correctly.

However, since your database credentials may have changed, you may need to adjust your configuration settings. In order to do so, go into the “app” directory > “Etc” and then edit the “local.xml” file where your credentials are located. You will need to get your database credentials from the MySQL Database and adjust your database name, admin, and password.

Make sure to save your changes.

If you experienced any issues, make sure that the path for your public_HTML directory is correct and that you followed all of the above steps properly.