In this guide
- Before you start: take inventory
- Step 1: Back up everything
- Step 2: Set up the new hosting account
- Step 3: Copy files and database
- Step 4: Test before you switch DNS
- Step 5: Lower TTL, then update DNS
- Step 6: SSL, email and final checks
- Common migration mistakes to avoid
- Step 7: Cancel the old host last
- Frequently asked questions
Key takeaways
- Keep your old hosting active until the new site is fully tested and DNS has switched over.
- Take a complete backup of files, database and email before you touch anything.
- Test the site on the new host before changing DNS, using a temporary URL or your computer’s hosts file.
- Lower your DNS TTL a day or two in advance so the switch propagates faster.
- Moving hosting and moving your domain are separate tasks. You can change hosts without transferring the domain.
A Black Friday deal on new hosting is only worth it if you can get your site there in one piece. Migration sounds intimidating, but the process is predictable: copy everything, test it in the new home, point your domain at the new server, and only then shut down the old one. Most problems come from doing those steps out of order. This guide walks through each one, with notes for WordPress sites and for email, which is the part people most often forget.
Before you start: take inventory
Spend fifteen minutes listing everything your current host does for you. It is easy to move the website and forget something that quietly lived alongside it.
- Website files, including uploads, themes, plugins and any custom code.
- Databases, with names, users and which site uses each one.
- Email accounts hosted with your provider, and how many messages each holds.
- DNS records, especially if your host also manages DNS. Note MX, TXT (such as SPF and DKIM), CNAME and A records.
- Scheduled tasks (cron jobs), redirects and server-level settings.
- SSL certificates, which you will need to issue again on the new host.
- Where your domain is registered, and your login for that registrar.
- Your renewal date on the old host, so you know how much time you have.
Take screenshots of your current DNS zone. If anything goes wrong later, that snapshot makes it easy to see exactly what changed.
Step 1: Back up everything
Before migrating, make a complete, downloadable backup and store it somewhere other than either host, such as your computer or a cloud drive. That copy is your safety net if anything goes wrong in transit.
- Download all site files through your control panel’s file manager, SFTP, or a backup tool.
- Export each database. Most control panels include phpMyAdmin or a similar export tool.
- Export email, if you are moving it, or make sure it is synced to a mail client.
WordPress’s own documentation explains that a full backup needs both the database and the files, recommends backing up before upgrades or moves, and suggests keeping several recent copies in different places, such as cloud storage and a local computer.
Step 2: Set up the new hosting account
Log in to your new host and add your domain to the account. Create any databases and database users you will need, and note the credentials. If your new host offers free migration, this is the point to request it, then skip ahead to testing. If you are doing it yourself, carry on.
Adding your domain to a new hosting account does not affect your live site. Nothing changes for visitors until you update DNS.
Step 3: Copy files and database
- Upload your files.Use SFTP or the new host’s file manager to upload your site files into the correct web root folder.
- Import the database.Use the new host’s database tool to import the export you made.
- Update configuration.Update the database name, username, password and host in your site’s configuration file. For WordPress, that is
wp-config.php. - Recreate extras.Set up cron jobs, redirects and any server settings from your inventory.
WordPress shortcut
For WordPress sites, a migration plugin can bundle files and database together and restore them on the new host. That is often the easiest path for smaller sites. If you are keeping the same domain, you generally do not need to change URLs inside the database. If the domain is changing, follow WordPress’s guidance on updating site URLs carefully: a plain find-and-replace across the whole database can break serialized data that some themes and widgets store. The official guide points to dedicated tools such as WP-CLI’s search-replace command instead.
Step 4: Test before you switch DNS
This is the step that prevents downtime. You want to see the site running on the new server while visitors still see the old one. Two common ways to do that:
Temporary or preview URL
Many hosts provide a temporary address or preview link for a new site. Check your new host’s dashboard.
Edit your hosts file
Your computer’s hosts file can map your domain to the new server’s IP address, just on your machine, so you can browse the real domain on the new host.
While testing, check:
- Home page and several inner pages load correctly
- Images, styles and scripts all load
- Contact forms send messages
- Logins and admin dashboards work
- Checkout or payment flows work in test mode, if you run a store
- Redirects behave as expected
Remember to remove the hosts file entry when you finish, or your computer will keep pointing at the new server regardless of public DNS.
Step 5: Lower TTL, then update DNS
Every DNS record has a time to live, or TTL, which tells resolvers how long they may cache it. A long TTL means some visitors could keep reaching your old server for longer after you make a change. A day or two before you switch, lower the TTL on the records you will change, then wait for the old TTL to expire.
When you are ready, you have two options:
| Option | What you change | When to use it |
|---|---|---|
| Change nameservers | At your domain registrar, point nameservers to the new host | When the new host will manage your whole DNS zone. Recreate all records, including email, there first. |
| Change A records | In your existing DNS, update the A (and AAAA) records to the new server’s IP | When you want to keep DNS where it is and only move the website. |
Switching nameservers replaces your entire DNS zone. If you forget to recreate MX and TXT records on the new host first, email can stop arriving. Compare against your screenshots before you switch.
Step 6: SSL, email and final checks
Once DNS points to the new server, issue or activate an SSL certificate there. Many hosts do this automatically using Let’s Encrypt once the domain resolves to them. Then visit the site over HTTPS and check for mixed-content warnings.
If email is moving too, create the same mailboxes on the new host before switching MX records, then import messages or let your mail client re-sync. If email is staying put, double-check that MX records were not changed by accident.
If your site uses a CDN or a separate DNS provider, confirm that it now points to the new server’s address too, and clear its cache so visitors do not see stale pages from the old host.
Finally, re-run your test checklist on the live domain, and keep an eye on any uptime monitor or analytics for a few days.
Common migration mistakes to avoid
Most migrations that go wrong fail in one of a handful of predictable ways. Knowing them in advance is most of the cure.
| Mistake | What happens | How to avoid it |
|---|---|---|
| Cancelling the old host first | The site goes offline with nowhere to fall back to | Cancel last, after testing and DNS propagation |
| Forgetting email DNS records | Email silently stops arriving after a nameserver change | Recreate MX, SPF and DKIM records before switching |
| Skipping the test step | Broken pages or forms are discovered by visitors | Test with a preview URL or hosts file before DNS changes |
| Leaving TTL high | Some visitors keep hitting the old server for longer | Lower TTL a day or two ahead |
| Editing the old site mid-move | New posts, orders or comments are lost | Pause content changes, or re-sync the database just before the switch |
| Blind find-and-replace on URLs | Widgets and theme settings break | Use a serialization-aware tool when the domain changes |
Timing the move
Pick a quiet period for your audience, such as a weekday evening for a local business or a weekend for a business-to-business site, and avoid your busiest sales days. If you run an online store, it is usually wise not to migrate in the middle of a holiday promotion. A Black Friday hosting purchase can wait a week or two for a calm switchover; your hosting term generally starts when you buy, so factor that into your timeline, but do not let it rush you.
Step 7: Cancel the old host last
Wait until you are confident everything works, DNS has fully propagated, and you have a fresh backup from the new host. Only then cancel the old plan. Download one last copy from the old account before you do, just in case.
Check whether cancelling hosting also affects a domain or email registered with the same provider. If your domain is registered there and you want to move it too, that is a separate domain transfer process under ICANN’s transfer policy, which involves unlocking the domain and getting its authorization code. Registrars may refuse a transfer within 60 days of registration or of a previous transfer, so check those dates first. Plan your old host’s renewal date into this: our guide to renewal-price traps explains how to avoid being billed for another term you will not use.
Frequently asked questions
Will my website go down when I change hosts?
It does not have to. If you keep the old hosting active, test the site on the new server first, and lower your DNS TTL before switching, most visitors will not notice the move.
How long does DNS propagation take?
It depends on the TTL values on your records and on how resolvers cache them. Lowering TTL ahead of time helps changes take effect faster. Keep the old host running until traffic has clearly moved.
Do I need to transfer my domain when I change hosts?
No. Hosting and domain registration are separate. You can keep your domain at its current registrar and simply point DNS to the new host.
Will I lose email when I migrate?
Not if you plan for it. Recreate mailboxes and DNS records like MX, SPF and DKIM on the new host before switching, or leave email where it is and make sure those records stay unchanged.
When should I cancel my old hosting?
Only after the site is fully tested on the new host, DNS has switched, and you have a fresh backup. Download a final copy from the old account before cancelling.
Choosing where to move?
Compare hosts side by side, including migration help, before you pick a new home for your site.
Compare hosts →Sources
- Moving WordPress — WordPress Developer Resources
- WordPress Backups — WordPress Developer Resources
- Transfer Policy — ICANN
- How It Works — Let’s Encrypt
- What is time-to-live (TTL)? — Cloudflare Learning Center
SideBySide Hosting publishes independent information to help you compare and switch web hosts. We are not affiliated with any hosting provider, and this article contains no affiliate links. Control panels and migration tools differ between hosts, so follow your providers’ own documentation, and always keep a full backup before making changes. Prices and terms change; verify current details on provider sites.