How to Move All cPanel Accounts from One Server to Another
Valid for versions 112 through the latest version
Last modified: August 16, 2024
Overview
This tutorial explains how to migrate your cPanel accounts, SSL certificates, and main server IP address from one server to another. Typically, you would do this when you need to replace your old source server with a new target server.
- Your websites will likely experience downtime during this process.
- We do not recommend that you transfer accounts with calendars or contacts data from a server that runs cPanel & WHM version 120 or later to a server that runs cPanel & WHM version 118 or earlier. If you do this, you will need to manually copy and import the accounts’ calendars and contacts data once the transfer has completed.
- This procedure assumes that your server’s IP addresses are portable, and that you can migrate them from the source server to the target server. If you use a third-party data center or hosting provider for your cPanel & WHM server, contact them to confirm that you can migrate your IP addresses.
Migrate your cPanel accounts
Install cPanel & WHM on your target server
Before you transfer the accounts, install cPanel & WHM on your new target server. To do so, follow the steps in our Installation Guide.
During the installation process, select a hostname and main IP address for the target server. You must select a main IP address that differs from your source server.
-
The replacement cPanel & WHM server should contain identical software to the old source server. This includes MySQL® or MariaDB®, PHP, PHP extensions, Apache®, Apache extensions, and other software options.
- If you do not use the same version of MySQL or MariaDB on the target server, you may encounter serious errors.
- If you cannot use the same version of a software on the target server — for example, because your version of MySQL has been deprecated — ensure that your source server’s version of that software is up-to-date before you start the transfer.
- If you wish to update any of the software on the target server, we strongly recommend that you perform the transfer first and then perform any updates.
-
Make certain that you copy your cPanel accounts’ Apache configuration to the target server. To do so, follow the steps in our Customize Your Installation documentation.
- cPanel & WHM requires a valid license. If this is a new installation, you can activate a free 15-day trial license.
- In order to activate a new license, you must have a cPanel Store account with a verified email address.
- The migration process will transfer your permanent license to the target server.
Copy all service configurations to the target server
- Make certain to transfer the account service configurations before you transfer the accounts. If you transfer the accounts first, your websites may experience issues.
- If you do not use a Server Name Indication (SNI)-capable operating system, make certain to copy all SSL certificates before you transfer accounts between servers. SSL certificates and keys reside in the
/etc/ssl/
directory.
To move all of your account service configurations from one server to another, use WHM’s Transfer Tool interface (WHM » Home » Transfers » Transfer Tool). Select the following service configurations in the Service Configurations tab of the Transfer Tool interface:
- AutoSSL options
- Backups
- cPanel & WHM (
whmconf
) - Database servers
- EasyApache
- Exim
- GreyList
- Hulk
- ModSecurity®
- User interface themes
Copy all accounts to the target server
Make certain to transfer your reseller accounts before your cPanel accounts. If you transfer the cPanel accounts first, they may lose their reseller ownership.
After you install cPanel & WHM on your target server, copy each account from your source server to your target server. We recommend that you use WHM’s Transfer Tool interface (WHM » Home » Transfers » Transfer Tool) to copy the accounts.
The Transfer Tool interface allows you to use the Live Transfer feature. This feature reduces downtime during transfers between cPanel & WHM servers. This feature is especially useful if you have external nameservers that your cPanel & WHM servers do not update, as the Live Transfer feature’s proxy configuration will ensure that traffic flows to the correct destination.
If you only possess user credentials and do not have root
access or privileges on the target server, use WHM’s Transfer or Restore a cPanel Account interface (WHM » Home » Transfers » Transfer or Restore a cPanel Account) to transfer the accounts.
Shut down your source server
After you copy your accounts to the target server, you can shut down your source server.
If you used the Live Transfer feature, we recommend that you keep the source server online for two days to allow the proxy features to function.
Finish your transfer
The following actions will let you finish preparing your target server to use the data and configurations you transferred from your source server:
Confirm that you possess a valid cPanel license
After you move all of your accounts to your target server, confirm that you possess a valid cPanel license. To do this, navigate to our License Verification interface.
Change the target server main IP address to the source server IP address
- If you purchased your license directly from WebPros International, LLC, or a third-party license provider, you must perform this step.
- We recommend that you do not perform this step if the following conditions are true:
- You wish to migrate your accounts to a target server with a new hosting provider.
- You purchased your cPanel license from your former hosting provider.
After you shut down your source server, change the target server’s main IP address to the IP address of your source server. Perform this action via the command line in a local session. A local session allows you to make changes, restart the network service, and remain connected to the server.
To change the server’s main IP address, perform the following steps:
- Open the
/etc/sysconfig/network-scripts/ifcfg-eth0
file. - Edit the
IPADDR
andGATEWAY
lines to use the IP address and gateway of your source server. - If your source server belongs to a DNS cluster, delete the DNS clusters in WHM’s DNS Cluster interface (WHM » Home » Clusters » DNS Cluster).
- Open the
/etc/ips
file with a text editor. - Add your source server’s primary IP address, netmask, and gateway to the file.
Note:
Remove the target server’s primary IP address from this file.
- Restart the network service with the following command:
- For servers running RHEL-based operating systems, run the
systemctl restart network
command. - For Ubuntu, run the
systemctl restart systemd-networkd
command.
- For servers running RHEL-based operating systems, run the
- Run the
/scripts/mainipcheck
command to add the IP address to the/var/cpanel/mainip
file. - Run the
/scripts/fixetchosts
command to add the IP address and hostname of your server to the/etc/hosts
file.
Check the IP addresses of the transferred accounts
When you transfer your accounts to the target server, the system may set the accounts’ IP addresses to the target server’s original main IP address. Check and update each account’s IP address with WHM’s IP Migration Wizard interface (WHM » Home » IP Functions » IP Migration Wizard).
Configure your target server’s DNS zone files
In WHM’s Basic WebHost Manager Setup interface (WHM » Home » Server Configuration » Basic WebHost Manager Setup), enter the same shared IP address and nameservers that your source server uses. The system will configure the DNS zone files of restored accounts on the target server with those settings.
Add the target server to the DNS cluster
If your server does not belong to a DNS cluster, proceed to the next step.
To add the target server to the DNS cluster, perform the following steps:
- Navigate to WHM’s DNS Cluster interface (WHM » Home » Clusters » DNS Cluster).
- Select Enable DNS Clustering.
- Click Change.
- Click Return to Cluster Status.
- Select the server to add to the DNS cluster from the Add a new server to the cluster menu.
- Click Configure.
Reinstall all SSL certificates
Proceed to the next step if your server meets the following conditions:
- The accounts on your server do not use SSL certificates from a Certificate Authority.
- Both of your servers use an SNI-capable operating system.
To upload an existing SSL certificate to your server, perform the following steps:
- Navigate to WHM’s Install an SSL Certificate on a Domain interface (WHM » Home » SSL/TLS » Install an SSL Certificate on a Domain).
- Paste the certificate into the text box, or click Fetch to upload a
.crt
file. - Click Submit to install the certificate.