How to Move All cPanel Accounts from One Server to Another
Version:
- 110
- 112
- Valid for versions 112 through the latest version
Last modified: July 9, 2024
Overview
This tutorial provides a step-by-step guide on how to migrate your cPanel accounts, SSL certificates, and main server IP address from one server to another. This process is generally needed when you are replacing your old source server with a new target server.
Warning:
- Expect some downtime for your websites during this process.
- Avoid transferring accounts with calendars or contacts data from a server running cPanel & WHM version 120 or later to a server with version 118 or earlier, as this will require manual transfer of calendar and contacts data.
- Ensure that your server’s IP addresses are portable and can be migrated. If you are using a third-party data center or hosting provider, confirm with them that IP migration is possible.
Migrate Your cPanel Accounts
1. Install cPanel & WHM on Your Target Server
Before transferring accounts, ensure that cPanel & WHM are installed on your new target server. Follow the steps in the Installation Guide for cPanel & WHM.
- Choose a Hostname and Main IP Address: Select a main IP address that differs from your source server.
Important:
- The new cPanel & WHM server should have identical software as the old server. This includes MySQL® or MariaDB®, PHP, PHP extensions, Apache®, Apache extensions, and other software options.
- If the same software version cannot be used due to deprecation, update your source server’s software to the latest version before starting the transfer.
- Perform the transfer before updating any software on the target server.
- Ensure that the Apache configuration is copied to the target server. Follow the steps in the Customize Your Installation documentation.
Note:
- cPanel & WHM require a valid license. You can activate a free 15-day trial license for new installations.
- You need a cPanel Store account with a verified email address to activate a new license.
- The migration will transfer your permanent license to the target server.
2. Copy All Service Configurations to the Target Server
Important:
- Transfer account service configurations before transferring accounts to avoid website issues.
- If not using a Server Name Indication (SNI)-capable operating system, copy all SSL certificates before transferring accounts. SSL certificates and keys are located in the
/etc/ssl/
directory.
Use WHM’s Transfer Tool interface (WHM » Home » Transfers » Transfer Tool) to move all account service configurations to the target server. Select the following 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
3. Copy All Accounts to the Target Server
Important:
- Transfer reseller accounts before cPanel accounts to retain reseller ownership.
Once cPanel & WHM are installed on your target server, copy each account from your source server using WHM’s Transfer Tool interface (WHM » Home » Transfers » Transfer Tool).
- Live Transfer Feature: This feature reduces downtime during transfers between cPanel & WHM servers. It is particularly useful if your servers do not update external nameservers, as the proxy configuration ensures correct traffic flow.
- If you do not have root access on the target server, use WHM’s Transfer or Restore a cPanel Account interface (WHM » Home » Transfers » Transfer or Restore a cPanel Account) for account transfers.
4. Shut Down Your Source Server
After transferring accounts to the target server, you can shut down your source server.
- Live Transfer: If used, keep the source server online for two days to allow proxy features to function.
5. Finish Your Transfer
Confirm a Valid cPanel License:
- After transferring accounts, ensure that you have a valid cPanel license. Use the License Verification interface to confirm.
Change the Target Server Main IP Address to the Source Server IP Address:
Important:
- Perform this step if you purchased your license directly from WebPros International, LLC, or a third-party license provider.
- Do not perform this step if:
- Migrating accounts to a target server with a new hosting provider.
- Purchased your cPanel license from your former hosting provider.
After shutting down the source server, change the target server’s main IP address to the source server’s IP address. Perform this action via the command line in a local session to make changes, restart the network service, and remain connected to the server.
Steps to Change the Server’s Main IP Address:
- 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 is part of 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:
- For servers running RHEL-based operating systems, run the command:
systemctl restart network
. - For Ubuntu, run the command:
systemctl restart systemd-networkd
.
- For servers running RHEL-based operating systems, run the command:
- 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 transferring 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 using 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), select the same hostname, shared IP address, and nameservers as your source server. 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:
Note: 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:
Note: Proceed to the next step if:
- The accounts on your server do not use SSL certificates from a Certificate Authority.
- Both 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.
By following these steps, you can successfully migrate your cPanel accounts, SSL certificates, and server configurations from one server to another while minimizing downtime and maintaining the integrity of your services.