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.
| Stage | What you do | Site still live? |
|---|---|---|
| 1. Prepare | Full backup, list DNS records, lower TTL | Yes, on the old host |
| 2. Copy | Upload files, export and import the database | Yes, on the old host |
| 3. Test | Preview the new copy via your hosts file | Yes, on the old host |
| 4. Switch | Change A or CNAME records, check SSL | Yes, on both while DNS updates |
| 5. Close | Watch old host traffic fall to zero, then cancel | Yes, 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.comExport 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.sqlCheck 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 MXWhich DNS records change
| Record | What it does | Change it? |
|---|---|---|
| A / AAAA | Maps the domain to the server's IP address | Yes, to the new host's IP |
| CNAME | Maps a name such as www to another domain name | Yes, if the new host asks for one |
| MX | Delivers email to your mail server | No, unless email is moving |
| TXT | Holds text such as email checks and site verification | Usually 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
- Work through the checklist from top to bottom; each stage depends on the one before it.
- Tick steps as you finish them. Your ticks are kept in this browser so you can come back later.
- Use the TTL helper to see how long to wait between lowering TTL and switching.
- Copy the command examples for backups, database moves and DNS checks.
- 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
- 120 Website Ideas, With the Pages Each One Needs
- Website Image Sizes: The Complete Table
- Website Launch Checklist: 31 Checks Before and After Go-Live | How-to Guide
- 25 Website Layout Examples (With Annotated Wireframes) | How-to Guide
- Website Maintenance Packages: How to Scope, Price and Quote Them | How-to Guide
- Website Navigation Examples for Small Businesses (Annotated) | How-to Guide
- Website Platform Procurement Checklist: 42 Questions to Ask Vendors | How-to Guide
- Website Platform Total Cost of Ownership: A Five-Year Model for Organisations Running Many Sites | How-to Guide
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App