Skip to content

How to move a WordPress site to a new host without downtime

· The AYT team · 3 min read

A technician with a laptop working at a server rack

Moving a WordPress site sounds riskier than it is. A site is two things: its files (mostly the wp-content folder) and its database. Copy both, put them on the new server, and only then change DNS, and visitors notice nothing. Problems start when the order is reversed, or when email is forgotten.

Before you start

Write a few things down, so you don't go looking for them halfway through:

  • where the domain is registered and where its DNS records are managed (the registrar, the old host or Cloudflare);
  • which mailboxes exist on the domain and who uses them;
  • the site's PHP version, in wp-admin under Tools → Site Health;
  • scheduled tasks (cron) and any special rules in .htaccess.

Don't cancel the old hosting yet. Keep it running for at least a week after the move.

Step 1: a full copy you made yourself

Download all of the site's files and export the database (from phpMyAdmin or with a backup plugin). Don't rely only on the old host's backup: if something goes wrong, you want a copy you control.

Step 2: lower the DNS TTL a day before

The TTL says how long networks remember the site's old address. If it is 24 hours, some visitors will reach the old server for a whole day after the change. Lower it to 300 seconds a day before the move; you can raise it again afterwards.

Step 3: put the site on the new server

Upload the files, create a new database, import the export and enter the new database name, user and password in wp-config.php. If the domain stays the same, there are no addresses to replace in the database.

Step 4: test before you change DNS

Add a line to your computer's hosts file with the new server's IP and the site's domain. Only your computer opens the site from the new server; everyone else still sees the old one.

Check the home page and a few inner pages, signing in to wp-admin, the contact forms and, for a shop, the cart and a test order. When everything works, remove the line from hosts.

Step 5: change DNS and issue the SSL certificate

Point the domain's A record (and the one for www) at the new server. With a short TTL, most visitors get there within minutes. Issue the SSL certificate as soon as the domain points at the new server, so browsers show no warnings.

Move the email too

If the domain's email was at the old host, create the same mailboxes on the new server, copy the messages (over IMAP, with an email client or a migration tool) and only then change the MX records. Otherwise mail sent during the move can be lost.

The first 48 hours

  • Don't publish posts or take orders on the old server: whatever is written there after the copy never reaches the new one.
  • Check that scheduled tasks run on the new server.
  • Look in Google Search Console for new crawl errors.
  • Cancel the old hosting only once you have checked nothing reaches it any more.

Or we move it for you

On AYT's paid plans, the move is free: we move every WordPress site the plan includes, with files, databases and mailboxes. All we need is cPanel, FTP or SSH access to your current host. The move is done within 2 working days, and the site stays online the whole time. After you order, open a ticket and we take care of the rest.

More articles

All articles