How to move a website to a new host

To move a website to a new host, make a backup, test the copy, then switch DNS. Write down your email settings before changing DNS so you know which records to keep.

Before you start

Don't cancel the old hosting yet. Keep it running until the new site has been live for at least a week and you've confirmed email is working. Keep a copy of the old DNS values so you can switch back if needed.

Also decide if the domain is moving too. You usually don't need to. Changing hosts only requires changing DNS records, and the domain can stay at its current registrar. Domain transfers have their own rules, including ICANN's 60-day restriction after a registration or previous transfer, so keep that as a separate project.

Step 1: Take inventory

Log in to your current host and DNS provider and write down:

  • Every DNS record for the domain. Export the zone file if your provider allows it, or screenshot every record.
  • Where email is hosted. Look at the MX records. If they point at Microsoft or Google, email isn't on the web host and must not be disturbed.
  • Any subdomains (shop., booking., portal.) and what they point to.
  • Forms, scheduled jobs and anything that sends email from the website.
  • The software and versions the site runs on (WordPress version, PHP version, database type).

Step 2: Make a full backup and keep a copy

Download all files and an export of every database to your own computer or cloud storage. If the old host has a one-click backup, use it, but also make sure you have the files yourself. This is your insurance if anything goes wrong.

Step 3: Lower the DNS TTL a day or two early

Every DNS record has a TTL (time to live), the number of seconds other systems are allowed to cache it. If your website's record has a TTL of 86400 (one day), some visitors may keep going to the old server for up to a day after you switch.

A day or two before the move, change the TTL on the records you'll be editing (usually the A record for the bare domain and the www record) to 300 seconds. Wait at least as long as the old TTL so caches pick up the short one. Keep both copies available during the switch because some visitors may still reach the old host.

Step 4: Set up the site on the new host

Upload the files, create the database, import the export and update the site's configuration with the new database details. Many hosts will do this migration for you, sometimes at no extra cost, and WordPress has migration plugins that handle most of it. Match the PHP version to what the site ran on before, at least to start.

Step 5: Test before anyone else sees it

Most hosts give you a temporary address to preview the site. If not, you can edit the hosts file on your own computer so only your machine sees the new server. Then click through everything:

  • Every main page loads, with images.
  • Contact forms send, and the message arrives.
  • Logins work, including the site's admin area.
  • Online payments or bookings work end to end in test mode.
  • The site is still fast on a phone.

Step 6: Switch DNS

If the site takes orders, bookings or edits, plan a brief pause on writes while you copy the latest data. Check HTTPS on both hostnames before switching where your host supports it. If payments or other critical features fail, pause writes and reconcile any new activity before pointing DNS back to the old host.

Change only the records for the website (usually the A/AAAA record for the domain and the www record) to the new host's values. Leave the MX and email-related TXT records alone unless email is also moving. If you're changing nameservers to the new host instead, recreate every record from your inventory there first, especially MX, SPF, DKIM and DMARC, or email will stop the moment the nameservers change.

Step 7: After the switch

  • Confirm the SSL certificate was issued on the new host and the site loads over https without warnings.
  • Send yourself an email from outside and reply to it, to prove mail flows both ways.
  • Submit a test through every form again on the live site.
  • Watch for 404 errors on old links, and redirect any URLs that changed.
  • Raise the TTL back to an hour or more once things are stable.
  • After a week or two, take a final backup from the old host, then cancel it.

Common mistakes

  • Changing nameservers without copying the email records. Email silently stops arriving, often for days before anyone notices.
  • Canceling the old host first. If something was missed, there's nothing left to copy it from.
  • Forgetting forms. The site looks fine, but contact forms send through the old server's mail settings and stop working.

If the site goes down partway through, our troubleshooting checklist covers how to find which piece broke.

Sources

Drafted with AI assistance. Report a correction.

Keep reading