When migrating a website, there are a number of issues to bear in mind in order to reduce downtime during migration and complete the migration quickly. We will discuss these issues below.
Shortcut: backup and restore with control panel
Most control panels include a feature you can use to easily move a website. First you make a backup of the accounts that are to be migrated. Then you restore the backup on the new server and redirect the DNS.
Configuring the server/account
The destination machine should be prepared before migrating an active website or e-mail accounts. Take into account databases with many updates.
A good approach to database migration is to start by running the database on the destination server. To do this, carry out an export/import at a quiet time (or pause the system for maintenance) and ensure you have configured the destination account so the database user can establish a connection from the IP address of the source account.
PHP / MySQL versions and modules
In an ideal situation, the web software is the same on the destination machine as on the source machine. Minor differences should not be an issue, e.g. PHP 4.4.7 and PHP 4.4.8, but major differences in software versions can cause problems. This is particularly true for MySQL: many queries that work well in MySQL 4.x are no longer accepted by MySQL 5.x for example. You should also check that special modules such as PHP / PECL / pSQL / Apache or optimisers like ionCube are available on both the source and destination machines.
It is important to carry out a thorough test to be sure of a successful migration. Testing will reveal issues that were not foreseen as well as subtle differences in configurations. One good way to test is to use the hosts file. This will be discussed in more detail later.
Create all the e-mail addresses you need on the new server. Turn off the catch-all address if this has not already been done; this can attract high volumes of spam. You can test the new accounts by logging in using webmail or by creating an account in your local e-mail client (Outlook, Thunderbird) in which you set the incoming server to the IP address of the destination server.
Once all the domain issues have been covered and the websites have been transferred and tested, then the domain can be migrated.
Redirecting the DNS
By changing the TTL (Time to Live) you can ensure that the domain names do not remain in the DNS caches too long. This will ensure that potential visitors and e-mail senders are quickly relayed to the new server location. To ensure that the DNS caches are quickly updated with the new DNS information, it is recommended that you set the TTL for the domain at 300 (TTL records are in seconds).
If you do not have control of the DNS, you can ask the current provider to implement the TTL change. Do realise, however, that a TTL change will not take effect until the prior TTL has elapsed. This can take up to 24 hours.
Once the TTL is set the way you want, you can redirect the domain to the new website location.
Executing the migration
Now that everything is ready, you can carry out the migration.