Website Hosting Migration Without Downtime

Copy the site to the new host while the old one keeps serving visitors, preview the copy through your computer's hosts file, and lower your DNS TTL a few days early. Then point the domain's records at the new server, leave mail (MX) records alone unless email moves too, and cancel the old plan only once its traffic stops.

The move in five stages
StageWhat you doSite still live?
1. PrepareFull backup, list DNS records, lower TTLYes, on the old host
2. CopyUpload files, export and import the databaseYes, on the old host
3. TestPreview the new copy via your hosts fileYes, on the old host
4. SwitchChange A or CNAME records, check SSLYes, on both while DNS updates
5. CloseWatch old host traffic fall to zero, then cancelYes, on the new host

Updated

Downtime during a host move almost always comes from doing things in the wrong order: cancelling the old plan first, switching DNS before the new copy works, or forgetting that email lives in the same DNS zone. This guide keeps the old site running until the new one is proven, and the checklist below lets you tick off each step as you go.

Hosting move checklist

0 of 16 steps done

Clear ticks

1. Prepare

  • Download a full backup of files and database from the old host
  • Write down every DNS record (A, CNAME, MX, TXT)
  • Lower the TTL on the records you will change
  • Pause content changes and orders on the old site

2. Copy

  • Upload the site files to the new host
  • Create the database on the new host and import the export
  • Update the site's database settings for the new host

3. Test

  • Add a hosts file line pointing your domain at the new IP
  • Test key pages, forms, logins and checkout on the new copy
  • Remove the hosts file line

4. Switch

  • Change the A or CNAME records to the new host
  • Confirm the MX and email TXT records are unchanged
  • Check the HTTPS certificate on the new host

5. Close

  • Watch old host traffic fall to zero
  • Check Search Console and URL Inspection
  • Cancel the old hosting plan

TTL helper

Your current TTL: 14400 seconds (4 h)

After lowering the TTL, wait at least 4 h before switching, so caches holding the old value have expired.

Ticks are saved in this browser only.

Commands for each step

Replace the example names, IP addresses and paths with your own. Run database commands on a server or computer that has the MySQL client installed.

Hosts file line for testing

203.0.113.10 stands in for the new server's IP address. Add both the bare domain and the www name.

# macOS / Linux: sudo nano /etc/hosts
# Windows (as administrator): C:\Windows\System32\drivers\etc\hosts
203.0.113.10  example.com
203.0.113.10  www.example.com

Export and import a MySQL database

mysqldump writes the database as SQL statements; the mysql client replays them into the new, empty database.

# On the old host
mysqldump -u olduser -p shop_db --result-file=shop_db.sql

# On the new host, after creating an empty database called shop_db
mysql -u newuser -p shop_db < shop_db.sql

Check what DNS returns

Run before and after the switch. The second command confirms the mail records did not change.

dig +short example.com A
dig +short example.com MX

Which DNS records change

DNS records in a hosting move
RecordWhat it doesChange it?
A / AAAAMaps the domain to the server's IP addressYes, to the new host's IP
CNAMEMaps a name such as www to another domain nameYes, if the new host asks for one
MXDelivers email to your mail serverNo, unless email is moving
TXTHolds text such as email checks and site verificationUsually no

Testing with the hosts file

Your computer checks its hosts file before asking DNS, so one line that maps your domain to the new server's IP address lets only you see the new copy under the real domain. Microsoft's own documentation suggests this for previewing a site on a new hosting provider.

On Windows the file is in C:\Windows\System32\drivers\etc and needs an administrator to edit. On a Mac or Linux it is /etc/hosts and needs sudo.

Copying a database site

Sites built on WordPress and similar systems keep content in a database. Export it from the old host (phpMyAdmin or mysqldump), create an empty database on the new host, import the file, and update the site's configuration with the new database name, user and password.

If your old host charges by the month, do not cancel until the new site has run cleanly for a while; a spare month is cheap insurance.

How it works

  1. Work through the checklist from top to bottom; each stage depends on the one before it.
  2. Tick steps as you finish them. Your ticks are kept in this browser so you can come back later.
  3. Use the TTL helper to see how long to wait between lowering TTL and switching.
  4. Copy the command examples for backups, database moves and DNS checks.
  5. Do the switch at a quiet time for your site, and keep the old host for at least a few days after.

Tips

  • Freeze changes on the old site (new posts, orders, plugin updates) from the database copy until the switch, or copy the database again just before switching.
  • Write down every DNS record before you touch anything; a screenshot of the DNS zone is enough.
  • If the new host offers a free temporary address for the site, use it for a first check, but also test with the real domain through the hosts file.
  • Remove the hosts file line after testing, or you will keep seeing the new server even if something goes wrong.
  • Check contact forms after the move; they often send mail through the host and may need new settings.

Frequently asked questions

How long does a hosting migration take?

The copying usually takes an hour or two for a small site. The waiting is the longer part: give the lowered TTL time to spread before you switch, then keep the old host running until its traffic stops, which Google's site-move guide treats as the signal to shut it down.

Will moving hosts hurt my SEO?

If the URLs stay the same and the site works throughout, Google's guide for moves without URL changes describes it as an infrastructure change. Watch Search Console afterwards, and use the URL Inspection tool to check that Googlebot can reach the new server.

What is a DNS TTL?

Cloudflare's documentation defines TTL as a field on DNS records that controls how long each record is cached. A lower TTL means resolvers check for changes sooner, so your switch reaches visitors faster.

Will my email stop working?

Not if your MX records still point at your mail provider. An MX record is what delivers email to a mail server. Moving web hosting changes the A or CNAME records; leave MX and the related TXT records as they are unless your email is moving too.

How does the new host get an SSL certificate?

Many hosts use Let's Encrypt. Its HTTP-01 check places a file on your server and must be done on port 80, so it only succeeds after the domain points at the new host. The DNS-01 check uses a TXT record and can be done before the switch if your host supports it.

Related: Domain vs hosting, MX records explained, Site migration SEO checklist, How much website hosting costs.

Build your site free or see all free tools. On We.Inc you can build your site free, with no card and no trial needed to start. AI building is on paid plans from $19 a month.

More in Guides

Product

Who It's For

Features

Resources

Company

View Sitemap