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

2. Copy

3. Test

4. Switch

5. Close

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

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.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Guides

We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.

Product

Who It's For

Features

Resources

Company

View Sitemap