Better performance, a better price or better support — there are many reasons to move a website to new hosting. But if the migration process is managed wrong, data loss or downtime can occur. This guide explains the steps to move a website to a new server with zero downtime.

Related reading: Server backup with rsync · 301 and 302 redirects · Connecting to a server with SSH

Preparation Before Migration

The key to a successful migration is preparation. Before starting the migration, do the following:

  • Take a full backup: Prepare a complete backup of the current site's files and database.
  • Prepare the new server: Install the necessary software like the web server, PHP and the database on the new server.
  • Make an inventory: List domains, email accounts, cron jobs and SSL certificates — the things that need to be migrated.
  • Choose a low-traffic time: Plan the migration for the period when visitor traffic is lowest.

Step 1: Lower the TTL Value

1-2 days before the migration, lower the TTL (Time To Live) value in your domain's DNS records — for example to 300 seconds. TTL determines how long a DNS record is cached. A low TTL lets the DNS change propagate quickly on migration day.

Step 2: Migrate Files and the Database

Copy the site's files to the new server. rsync is ideal for this job — it transfers large site directories efficiently:

# Transfer files from the old server to the new server
rsync -avz -e ssh /var/www/site user@new-server:/var/www/

# Export the database (on the old server)
mysqldump -u user -p database > site.sql

Transfer the database backup to the new server and import it there. Do not forget to update the database connection details in the site's configuration file to match the new server.

Step 3: Test on the New Server

Before changing DNS, it is essential to test the site on the new server. You can do this by adding a temporary entry to your own computer's hosts file — this way only you point the domain to the new server's IP. If the site opens without issues on the new server, you are ready to migrate.

Step 4: Point DNS to the New Server

If the test is successful, update the domain's DNS records (the A record) to the new server's IP address. Thanks to the low TTL, the change starts propagating quickly.

Warning
Do not shut down the old server right after the DNS change. Until DNS propagation completes worldwide (usually 24-48 hours), some visitors still reach the old server. Keep the old server up for at least a few days — this way no one experiences downtime.

Step 5: Post-Migration Checks

After the migration completes: verify that the SSL certificate is valid on the new server, that email flow works, that cron jobs are set up and that dynamic functions including forms work without issues. After a few days, once you are sure everything is stable on the new server, you can shut down the old server.

Frequently Asked Questions

Does hosting migration harm SEO?

A correctly done migration — when the URL structure is preserved and there is no downtime — does not harm SEO. The server changes, but because the content and addresses stay the same, nothing changes from the search engines' point of view.

Does the site go down during migration?

With the method in this guide, no. The new server is prepared, tested and DNS is transitioned smoothly while the old server stays up; the visitor sees no downtime.

Do I need to transfer my domain too?

No. Migrating hosting is different from transferring the domain. In most cases it is enough to point DNS records to the new server; the domain registration can stay where it is.

Zero-Downtime Migration Support

Move your site to new infrastructure with zero downtime and free migration support on KEYDAL hosting solutions. Explore KEYDAL hosting

WhatsApp