All systems operational Your IP: 216.73.217.154 info@cloudhosting.lv +371 66 66 29 69 Client area

← All questions

How to move your website to new hosting without downtime

What website migration really means

A website migration is the process of moving your site's files, database, email and DNS records from one hosting provider to another. Done carelessly, visitors see errors or an outdated copy of the site for hours. Done properly, the switch is invisible: the same pages keep loading while the underlying server quietly changes. This guide walks through a zero-downtime website migration you can run yourself, whether you are moving a WordPress blog, a WooCommerce shop or a custom PHP application.

Step 1: Inventory what you are moving

Before touching anything, list every moving part:

  • Website files (the document root, uploads, themes, plugins).
  • The database, plus its name, user and character set.
  • PHP version, extensions and any cron jobs.
  • Email accounts, forwarders and mailbox data.
  • DNS records: A, AAAA, MX, TXT (SPF, DKIM), CNAME.
  • SSL certificates and any custom server configuration.

A migration fails most often because one of these was forgotten, not because the copy went wrong.

Step 2: Lower your DNS TTL first

The single most important trick for a downtime-free move is done days in advance. Find the TTL (time to live) on your domain's A record and lower it to 300 seconds. TTL tells resolvers how long to cache your old IP, so a high value means visitors keep hitting the old server long after you switch. Lower it at least 24 to 48 hours before migration day so the change has time to spread.

dig +nocmd yourdomain.com A +noall +answer
; read the TTL column, then set it to 300 in your DNS panel

Step 3: Copy files and database to the new host

Provision the new account, then transfer the data. rsync over SSH is reliable and resumable:

rsync -avz -e ssh ./public_html/ user@new-server:/home/user/public_html/
mysqldump -u olduser -p olddb > site.sql
scp site.sql user@new-server:~/
# on the new server:
mysql -u newuser -p newdb < site.sql

Update the application config (for WordPress, wp-config.php) with the new database name, user and password.

Step 4: Test before you switch anything

Never point DNS at an untested server. Preview the new site by overriding DNS only on your own computer. Edit your hosts file and add the new server's IP:

# /etc/hosts (Linux/macOS) or C:\Windows\System32\drivers\etc\hosts
203.0.113.10   yourdomain.com www.yourdomain.com

Your browser now loads the new server while the rest of the world still sees the old one. Click through key pages, submit a form, test checkout and login. Fix issues while the live site is untouched.

Step 5: Final sync and the DNS switch

On cut-over day, do a final sync to catch recent changes (new orders, comments, uploads). For busy sites, put the source into maintenance or read-only mode for a few minutes during this last copy, so no data is written to the old database after you export it. Then change the A record to the new IP.

Because you lowered the TTL, most visitors move within minutes. Keep the old hosting active for at least 48 hours: traffic drains gradually as caches expire, and both servers should serve the same content during that window.

Step 6: SSL, email and verification

Install and validate the SSL certificate on the new host so HTTPS works the moment DNS points there. Recreate MX records and mailboxes, and send a test message in both directions. Watch server logs and an uptime monitor for 24 hours. Confirm forms, payment callbacks and cron jobs run on the new box.

Practical takeaway

Zero-downtime migration is mostly preparation: lower the TTL early, copy and test on the new server before you touch DNS, then keep the old host running until traffic has fully moved. If you would rather not do it alone, the CloudHosting team migrates sites into our Riga, Netherlands and Dubai data centres and can handle the whole cut-over, with 24/7 human support and EU data sovereignty under NIS2 and GDPR.

Just need somewhere to put the site?
Shared cPanel hosting with NVMe, daily backups and mail, and none of the server administration above.
See what it costs

Ready to start?

Deploy in minutes or talk to an engineer about what fits your project.