How to transfer a site to a new hosting without downtime
Transferring a site to a new hosting seems difficult only at first glance. In fact, most problems are not due to the migration itself, but to haste: forgetting to make a backup, not checking the database, changing the DNS incorrectly, or not testing the site before launch.
To ensure that the site remains accessible to users, the migration must be done in stages. The main thing is not to turn off the old hosting until the new version of the site is fully operational on the new server.
Why you need to plan your site migration in advance
Site migration is not just copying files. Along with the site, you often need to transfer the database, mail, SSL certificate, CMS settings, cron jobs, redirects, DNS records, and other technical parameters.
If you do everything without preparation, the site may temporarily stop opening, forms may not send applications, the online store may lose some orders, and the mail may stop receiving letters.
Planning helps to avoid downtime. You prepare copies in advance, check the compatibility of the new hosting, transfer the site in test mode, and only then switch the domain.
What to prepare before migration
Before transferring, you need to collect all accesses and make a backup copy of the site. This is a basic step that should not be missed.
Prepare:
- access to the old hosting;
- access to the new hosting;
- access to the domain or DNS panel;
- site files;
- database;
- data from the mail, if it works on the old hosting;
- SSL certificate or the ability to issue a new one;
- a backup copy of the site before starting work.
You should also check the PHP, MySQL/MariaDB version, CMS settings, and site server requirements. If the site runs on WordPress, OpenCart, Drupal, or another CMS, the new hosting should support the required environment.
How to transfer a site to a new hosting without downtime
First, the site is copied to the new hosting, but the domain is not switched yet. This allows you to test the new copy of the site without affecting users.
After copying the files, you need to import the database, update the configuration files, and check the connection to the database. For CMS, these can be files like wp-config.php, .env, config.php, or other settings, depending on the system.
Next, the site is checked via a temporary domain, a technical link, or by changing the hosts on the computer. This allows you to open the site from the new hosting without changing the DNS for all users.
When everything is working correctly, you can switch the domain to a new hosting. To do this, change the NS servers or DNS records. Most often, you need to update the A record of the domain to the IP address of the new server.
After changing the DNS, the site may open from the old or new hosting for a certain time while the records are updated. That is why you should not turn off the old hosting immediately. It is better to leave it active for a few more days.
What to check after the transfer
After the migration, you need to go through the site and check not only the main page, but also key functions.
Check:
- whether all the main pages open;
- are the application forms working;
- is the shopping cart and checkout working, if it is an online store;
- is the database connected correctly;
- is the admin panel working;
- are there any errors in the links;
- is the SSL certificate installed;
- is the mail working;
- are the images and files missing;
- whether the site loading speed has changed.
It is also worth checking redirects from http to https, www / non-www operation, as well as indexing of important pages. If the site has integrations with CRM, payment systems or delivery services, they also need to be tested.
Typical mistakes during migration
One of the most common mistakes is to turn off the old hosting immediately after copying the site. Because of this, some users may end up on an inaccessible resource