How to Move All cPanel Accounts from One Server to Another: A Step-by-Step Guide
Migrating all cPanel accounts from one server to another can seem like a daunting task, especially if you are managing a large number of accounts. However, cPanel offers built-in tools that make this process smooth and efficient, ensuring minimal downtime and hassle. Whether you’re upgrading your server hardware, moving to a new data center, or changing hosting providers, this guide will walk you through the process of transferring all cPanel accounts from one server to another.
Prerequisites for the Migration
Before beginning the migration, there are a few prerequisites and preparations to ensure the process goes smoothly:
- Root Access: You must have root access to both the old and new servers.
- Matching Software Versions: Ideally, the versions of cPanel/WHM, Apache, PHP, and MySQL/MariaDB should be similar or compatible between the two servers.
- DNS Configuration: If you are using your own DNS servers, ensure that you can update the DNS records to point to the new server’s IP addresses.
- Sufficient Resources: Make sure the new server has enough resources (CPU, RAM, disk space) to handle all the accounts being transferred.
- Backup Plan: Always create backups of all accounts on the old server to avoid any potential data loss.
Step 1: Prepare the New Server
The first step is to ensure that the new server is properly configured and ready to receive the cPanel accounts. Here’s what you’ll need to do:
1.1 Install cPanel/WHM on the New Server
Make sure cPanel and WHM are installed and licensed on the new server. If cPanel is not already installed, you can install it using the following command:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
Follow the prompts to complete the installation. After installation, log into WHM on the new server and complete the initial configuration.
1.2 Configure Basic Settings
Set up your new server’s hostname, networking, and basic security configurations. Ensure that the server is fully updated and configured for production use.
Step 2: Enable Account Transfer on the New Server
cPanel’s WHM Transfer Tool allows you to copy accounts from the old server to the new one with minimal effort.
2.1 Access WHM Transfer Tool
On the new server, log into WHM and navigate to:
WHM > Transfers > Transfer Tool
The Transfer Tool will guide you through copying accounts from the old server.
2.2 Connect to the Old Server
In the Transfer Tool interface:
- Remote Server Address: Enter the IP address or hostname of the old server.
- Remote SSH Port: Enter the SSH port of the old server (default is 22 unless it was changed).
- Authentication: Enter the root username and password for the old server. Alternatively, you can use an SSH key for authentication.
Once connected, you will see a list of all accounts available for transfer.
2.3 Select Accounts to Transfer
You will be presented with a list of cPanel accounts from the old server. You can choose to:
- Transfer all accounts or
- Select specific accounts to migrate.
You also have the option to transfer settings such as DNS zones, packages, and reseller privileges.
2.4 Configure Transfer Settings
Before initiating the transfer, configure any additional options:
- Express Transfer: Enables automatic DNS updates and ensures that accounts on the old server will no longer resolve after migration. This is useful if you want the move to happen quickly without manual DNS changes.
- Mail Routing: Choose how email routing is configured after the transfer (local, remote, or automatic).
2.5 Initiate the Transfer
Click the Copy button to begin the transfer. WHM will copy each account, including all files, databases, emails, and settings, from the old server to the new one. The time required will depend on the size of the accounts and the speed of your servers’ network connections.
Step 3: DNS Updates
Once the transfer is complete, you need to update the DNS records so that domains point to the new server.
3.1 Update DNS Zones
If you’re using your own DNS servers, update the IP addresses for each domain to reflect the new server’s IP. If you opted for the Express Transfer, this may have been done automatically.
3.2 Update Registrar Information
If you’re using an external DNS provider or managing DNS through a domain registrar, log in to the registrar’s portal and update the A records to point to the new server’s IP address.
3.3 Verify Propagation
Use tools like whatsmydns.net or dig to ensure that DNS changes are propagating correctly. Propagation can take up to 48 hours, although it often happens much quicker.
Step 4: Post-Migration Testing
After the accounts are transferred and DNS changes have propagated, it’s important to test everything to ensure that the migration was successful.
4.1 Verify Websites and Databases
Check each website on the new server to ensure that it loads correctly. Verify that databases are functioning as expected, especially for sites running on content management systems like WordPress, Joomla, or Magento.
4.2 Email Functionality
Test email accounts by sending and receiving messages. Ensure that email routing and delivery are functioning properly on the new server.
4.3 Check Account Data
Log into cPanel for each transferred account to ensure that files, databases, emails, and settings have been successfully transferred. This includes verifying SSL certificates, cron jobs, and other configuration settings.
Step 5: Cleanup and Finalization
Once the migration is confirmed to be successful, you can proceed with the following final steps.
5.1 Disable Accounts on the Old Server
To prevent data changes or discrepancies, disable the accounts on the old server. You can either suspend them through WHM or stop the web server services entirely to prevent access.
5.2 Create Backups
While the accounts are now hosted on the new server, it’s a good practice to create a fresh backup of each account post-migration. This ensures you have a recovery point in case of any unforeseen issues.
5.3 Monitor the New Server
For the next few days, monitor the performance and stability of the new server to ensure it can handle the transferred accounts without issues. Use tools like cPanel’s Resource Monitor and other server metrics to track server load, disk usage, and performance.
Conclusion
Migrating all cPanel accounts from one server to another may seem complex, but with cPanel’s built-in Transfer Tool, the process becomes relatively straightforward. Following this guide ensures that all your data, including websites, emails, and databases, are transferred correctly with minimal downtime.
Whether you’re moving to a more powerful server or switching hosting providers, this step-by-step process will help you make the migration smoothly and efficiently. Just remember to double-check everything post-migration to avoid potential issues, and you’ll have your accounts running on the new server in no time!