Introduction
The exact details of how to transfer various types of data from a non-standardized server environment to cPanel can vary widely. While this guide won't serve as an exact step-by-step reference, it will provide an overall framework that you may use as a reference to improve the experience for you and your clients.
The Overall Process
NOTE: Do not delete anything until the transfer has completed, all functionality has been tested. Even then, it would be prudent to keep a backup of the entire old server for an even longer period of time in some situations.
1. Determine which types of data you will need to transfer. The 4 typical types of data involved in migration are listed under the below section labeled: Transferring Data
Knowing what kinds of data you will need to transfer will help inform you of the types of tools and steps that will be required to complete the transfer.
2. Investigate the health of DNS, databases, critical services, and other various logs before the transfer on both the destination and source server. If you skip this due diligence before making changes, you may find very unfortunate surprises that degrade the transfer experience for you and your clients.
3. Create a cPanel account on the destination server, along with all of the databases, database users, email accounts etc.
4. Identify any custom software that was installed on the source server and install it on the new server.
5. Copy over any custom configurations that were used on the old server, and/or tweak the configurations on the destination server to be compatible with what was found on the old server.
6. Start to transfer the various types of data over to the new server.
7. Test the sites, databases, and email functions on the destination server before actually changing the DNS over to verify that things are working fine. The best way to test a website before the DNS has changed over is to edit your hosts file:
How Can I View my Site Without Pointing DNS
8. After you are satisfied with the testing results, update the DNS to point your services over to the destination server. It is important to keep the old server up and running long enough for DNS propagation to complete.
You can test the overall health of the DNS configuration with these tools:
You can get a general idea for how far along DNS propagation has come with the following tool:
Transferring Data
There are typically 4 types of data that need to be transferred between servers. Considering what data will be required before you start can be very helpful.
Website Data
This is all of the code and data required to allow a website to function. Typically you can find most if not all of this data within the directory that is specified by the DocumentRoot directive within the Apache configuration file which is usually called named httpd.conf. Be careful to have an understanding of the storage mechanisms that the code of the site uses. Some sites may make use of unusual storage options such as remote storage, or storage in unexpected locations on the server.
Typically moving this kind of data is best performed with the rsync utility:
How To: Manual Account Transfer With Rsync
Email Data
Email Data can be tricky to transfer because it is often changing very quickly, and must be handled in a special manner as compared with typical files to avoid headaches down the road. Fortunately, with the right tools, this actually becomes a pretty painless task for the most part. We have a guide that explains how to use the Imapsync utility for this task:
How to Sync IMAP Mailboxes Using Imapsync
Database Data
Websites often make use of various types of databases to store data. The most common would be MySQL.
The following guide shows some excellent examples of how to create backups of your databases with mysqldump which would be available on any server that makes use of MySQL:
You could then use PHPMyAdmin to import any of the individual database backups that you generated above:
How to Import and Export Databases via PHPMyAdmin
If your databases are too large, or if you prefer to use the command line you may use the following guide to import them into the destination server:
How to import or restore a database via SSH
Configuration Data
Becoming familiar with the configuration details of the server that you're migrating from may not be strictly required, but can make the difference between a difficult transfer and a professional transfer with fewer problems. These are some common services that you could check for:
- MySQL
- PHP-FPM and PHP
- Apache
- NGINX
- Cron
- Firewall
- Exim including forwarders and filters
Comments
0 comments
Article is closed for comments.