Skip to content

Web Development & Performance

The Complete Zero-Downtime Website Migration Checklist

Last reviewed

Summary: To migrate without downtime: lower your DNS TTL a day or two ahead, copy files and the database to the new server, test the new server privately using your computer's hosts file, freeze changes and do a final sync, then switch DNS. Keep the old server running until traffic has fully moved.

Migration timeline
  1. 01

    T-48 h

    Lower TTL to 300 s

  2. 02

    T-24 h

    Initial rsync + DB copy

  3. 03

    T-2 h

    Hosts-file testing

  4. 04

    T-0

    Freeze, final sync, switch DNS

  5. 05

    T+72 h

    Raise TTL, retire old server

Pre-flight

  • Full backup of files, database and email taken and downloaded
  • Inventory of DNS records exported
  • New server built and hardened with matching PHP/runtime versions
  • Cron jobs, environment variables and SSL needs listed
  • TTL on A/AAAA/CNAME records lowered to 300 seconds

Copy files with rsync

terminalbash
# Run from the new server; repeat later for a fast incremental sync
rsync -avz --delete -e ssh olduser@old.server.ip:/var/www/example.ca/ /var/www/example.ca/

Copy the database

terminalbash
# On the old server
mysqldump --single-transaction --quick --routines app | gzip > app.sql.gz
# On the new server
scp olduser@old.server.ip:app.sql.gz .
gunzip < app.sql.gz | mariadb app

Test privately with your hosts file

Point your own computer at the new server while everyone else still sees the old one. Add a line to /etc/hosts (macOS/Linux) or C:\Windows\System32\drivers\etc\hosts (Windows):

terminaltext
203.0.113.50  example.ca  www.example.ca

Browse the site, submit forms, log in and check checkout flows. Remove the line when finished.

Cut-over

  1. Put the old site in maintenance or read-only mode for dynamic sites (stores, forums).
  2. Run a final rsync and database export/import.
  3. Update the A/AAAA records to the new IP.
  4. Issue the TLS certificate on the new server once DNS resolves.
  5. Watch access logs on both servers; the old one should go quiet within minutes to hours.

Post-migration

  • HTTPS valid on all hostnames
  • Email (MX, SPF, DKIM) still working
  • Cron jobs and backups running on the new server
  • No new 404 or 5xx errors in logs — see HTTP status codes
  • TTL raised back to 3600
  • Old server cancelled only after a week of quiet

Need DNS background? Read understanding DNS records. Choosing a destination? See the Canadian hosting guide. More in web development.

Get new technical guides by email

Occasional, practical server and hosting tutorials for Canadian webmasters. Unsubscribe any time.