How2Lab Logo
tech guide & how tos..


How to move/migrate a cPanel account from one server to another?


Transferring your cPanel account from one server (referred as source) to another server (referred as target / destination) can be done in a few different ways. The majority of alternative techniques that aren't covered here call for root-level WHM access to your target server. In this post, I'll go over a technique that should work for everyone, particularly if your destination and source cPanel accounts are on shared servers and you only have access to your cPanel with no root privileges. To migrate using this method, you do not need to have any access to WHM.


Step 1: Preparation before migration

For the migration, we'll make use of the cPanel's Backup and Restore functions. There is limitation on the total amount of data that cPanel can successfully restore. This limit is around 4 GB. Migration may not succeed if your website's email and file use exceeds 4 GB on disk. Therefore, it's important to perform some preliminary cleanup in order to minimize the overall amount of your data. Further, you will be able to complete the move more quickly if you reduce the size.

If you are unable to get your overall data size down to less than 4 GB, I will outline your options later in this post.


Open the File Manager interface in your source cPanel, and manually perform the following actions to reduce disk usage:

Link to open the File Manager

Folders to look into for old unwanted files


  1. Delete old log files under logs folder.

    These types of files can safely be deleted


  2. Delete all unwanted files and folders under your website's public_html directory. These could be past backups of old website designs and associated pages and image files that you are no longer using.


  3. Delete all old stats and logs files. These are under various sub folders of your tmp folder.

    Navigate through each sub-folder and delete old dated log files


  4. Delete all emails in the trash folders of each email account.


After the cleanup, you can check how much space your account is using from the Disk Usage section in your source cPanel. If the disk usage is below 4GB you are good to proceed.


What if your disk usage is still more than 4 GB?

Even after you have removed all unwanted files, if your website and emails are using more than 4 GB space, you need to download few folders to your local computer and keep them for uploading later after all other steps are done. Essentially, there are 3 parts of a website that consume space - your website files, emails, and database(s). To keep matters simple, I will only explain how to reduce the size of your website files and email accounts. The database migration becomes too technical when database size is big. We will therefore not cover the database part in this article. Perhaps, in future, I will write another article to specifically cover the same.

Reducing website space: Connect to your source cPanel server via any ftp client and download everything under public_html directory. You need to download all files, sub-directories and their full content. After you have downloaded everything under public_html, you can safely delete all contents under this directory on your source server. This will in all likelihood, reduce your overall disk usage below 4 GB.

Reducing email space: If you still need to reduce space further, download the full contents of your mail directory in the source server. After finishing the download, drill down to each sub-directory under the mail directory of the source server and only delete the email files that are under cur, new and tmp sub directories of each of your email account.


Now you are ready to proceed to the next step. Make sure that the destination cPanel account has enough capacity - at least 1.25 times the amount of space being used on the source server.


Step2: Create new cPanel account on destination server.

You will need this step only if your destination server is a dedicated server or VPS or reseller server, where you have WHM access. If you purchased one off cPanel hosting only for your domain that you wish to move, you already have a cPanel account created, so you can skip this step. Check this article to learn how to create a new cPanel hosting account in WHM.

Important!

The Username of your new cPanel account must be exactly the same as that of your source cPanel account. If it isn't please contact your hosting provider and ask them to make the username same in the destination server.


Step 3: Prepare new hosting account on destination cPanel

  1. Create your mysql or mariadb database on the destination server with the same db name as on your source server. Create a db user with same username and password as on source server. Assign user to database. These can be easily done from the MySql Databases section in your cPanel. If your website does not use any database, skip this step.
  2. Set you PHP version. From MultiPHP Manager in cPanel of source server, check the PHP version and set the same version on the destination cPanel. If your website does not use PHP and is only built with html, css and javascript, skip this step.

Step 4: Backup from source cPanel

Navigate to the backup section in your cPanel. See screenshots below as a guide.

Click at the Backup Wizard button

Next, click at Back Up button

You are only concerned with the 3 buttons under the Partial Backup sub-section

  1. Backup your Home Directory. This will download a zipped file with the name such as - backup-mywebsite.com-10-9-2024.tar.gz in your local computer's Downloads directory.
  2. Backup all your MySQL Databases. When you open this backup sub-section, you will see a list of links with database names - one for each database. One by one download all database files. These will be zipped files such as - mywebsit_master.sql.gz. In most cases you would be having only one database and hence you will see only one download link. If you do not have any database, you will not see any link and hence there is nothing for you to do here.
  3. Download your Email forwarders & filters. When you open this backup sub-section, you will see a couple of links - one for forwarder (downloaded as a zipped file with name such as aliases-mywebsite.com.gz) and the other for filter (downloaded as a zipped file with name such as filter_info.mywebsit.yaml.gz). Download each of these.

Step 5: Restore on destination cPanel

Now open your destination cPanel. Navigate to the Backup Wizard >> Restore section here and one by one restore all downloaded files. You can restore files under each sub-section by clicking at the respective button and uploading the concerned zipped files (that you downloaded earlier) one by one.


Step 6: Uploading Email & Website files

This step is required if you earlier downloaded (via FTP) your website and email files in order to reduce space.

Connect to the new server via ftp. Note that since your domain is still pointing to the old server, you will need to connect using the new server IP address in place of domain name. After you are connected via ftp, upload the email files under the mail directory of destination server. You can upload everything that was downloaded as mail directory. Likewise, upload everything that was downloaded as public_html under the public_html directory of destination server.


Step 7: Update Nameservers of your Domain

Now that you are all done, update the nameservers of your domain by replacing the current nameservers of your domain with that of the destination server. This can be done from your domain management control panel provided by your domain provider. Once you have updated your nameservers, wait for 4-24 hrs for the newly assigned nameservers to propagate. After the nameservers have propagated, if your hosting cPanel includes an Auto SSL feature, run the auto SSL to activate https access for your website.


Your website on the destination server is now all setup and available for the visitors.


Share:
Buy Domain & Hosting from a trusted company
Web Services Worldwide
About the Author
Rajeev Kumar
CEO, Computer Solutions
Jamshedpur, India

Rajeev Kumar is the primary author of How2Lab. He is a B.Tech. from IIT Kanpur with several years of experience in IT education and Software development. He has taught a wide spectrum of people including fresh young talents, students of premier engineering colleges & management institutes, and IT professionals.

Rajeev has founded Computer Solutions & Web Services Worldwide. He has hands-on experience of building variety of websites and business applications, that include - SaaS based erp & e-commerce systems, and cloud deployed operations management software for health-care, manufacturing and other industries.


Refer a friendSitemapDisclaimerPrivacy
Copyright © How2Lab.com. All rights reserved.