
Short answer: To migrate WordPress to a new host without downtime, keep the old site running while you build an exact copy on the new server. Test that copy through your computer’s hosts file so the site’s URLs never change. Then pause orders and edits, copy the database one last time, and point DNS at the new server. Keep the old server untouched until traffic, email and scheduled tasks have all moved. Most failed moves come from what gets left behind (email records, a final batch of orders, scheduled tasks still running on the old copy), not from copying the files.
Our guide to WordPress hosting benefits covers why a site might need a better host and what to look for in one. This article covers what comes next: the move itself, step by step, for a WordPress site that keeps its domain name. If you’re still deciding whether to switch providers or just upgrade your plan, start with our guide to upgrading your web hosting plan, which also gives a short general checklist for any host move.
A WordPress site is more than its files and database. A host move can touch up to eight separate things, and only the first two live inside WordPress:
| Item | Where it lives | Moves with a WordPress migration plugin? |
|---|---|---|
| Files: WordPress core, themes, plugins, uploads | The old server’s web folder | Yes |
| Database: posts, pages, orders, users, settings | The old server’s MySQL or MariaDB | Yes |
| The wp-config.php database settings | The site’s root folder | Usually rewritten for the new server |
| DNS records: A, MX, TXT, CNAME, CAA | Whoever runs your nameservers | No |
| Email mailboxes and their contents | The old host’s mail server, if email is hosted there | No |
| TLS certificate | Issued to the old server | No. The new server needs its own |
| Scheduled tasks and server cron jobs | WordPress, and the old host’s control panel | Partly |
| Third-party connections: payment webhooks, form services, IP allowlists | Outside services pointing at your site or server | No |
Write down which of these apply to your site before you start. The domain registration is a separate item again. 4GoodHosting’s guide to transferring a domain makes the point directly: transferring the registration is separate from moving website files. You don’t need to transfer the domain to move the site, and doing both at once adds a second moving part. Move the site first, then transfer the registration later if you want everything with one provider.
If the new host offers to move the site for you, that’s usually the lower-risk route. The host does migrations regularly and can see both ends of the copy on its own servers. 4GoodHosting’s migration guide describes its offer like this:
Even when the host does the copying, the decisions in this guide are still yours. You choose the cutover time, check the new copy, decide when to pause orders, and decide when the old server can go. Ask the host which of those steps it handles and which it leaves to you.
Doing it yourself makes sense when the site is small, you’re comfortable with SFTP and a database tool, or the host doesn’t offer migration help. There are three common DIY routes:
Whichever route you choose, take a full backup first and keep a copy off both servers. Our website backup strategy guide explains what a complete backup includes.
Visitors only notice a move when the old site is switched off before every visitor and service has reached the new one. The timeline below avoids that gap by keeping both copies working and switching DNS only once the new copy has been tested. The timings are a typical pattern, not a rule.
| When | What you do | Why |
|---|---|---|
| About a week before | Lower the DNS TTL. Copy every DNS record. Check the new plan’s PHP and database versions. | So the switch spreads quickly, and nothing in DNS gets lost |
| A few days before | Copy files and database to the new host. Test through your hosts file. | So you find problems while the old site is still live |
| Cutover day, quiet hour | Pause orders and edits. Copy the database one last time. Switch DNS. Run the certificate setup. | So no order or edit lands on the wrong server |
| First 48 hours | Watch both servers. Check email, forms, payments and scheduled tasks. | DNS changes reach different visitors at different times |
| After a week or more | Stop everything on the old server, then cancel it | Only once nothing still reaches it |
Every DNS record has a TTL (time to live), which tells resolvers how long they can keep a cached copy. Google’s guide to changing your web hosting recommends lowering it to a conservative low value, such as a few hours, at least a week before the move, so DNS caches refresh faster when you switch.
There are two ways to point the domain at a new server, and they behave differently:
Before a nameserver change, export or screenshot the full zone at your current DNS provider. Check each record in the new host’s DNS editor before you switch. Pay particular attention to:
If you use Cloudflare, decide early who will host DNS. 4GoodHosting’s Cloudflare guide describes both setups. With Cloudflare running DNS, you change the A records in Cloudflare to the new server’s IP address, and mail-related records must stay correct. The guide warns that a wrong Cloudflare proxy setting on mail hostnames breaks email.
If the domain stays the same, the move is simpler than many guides suggest. WordPress’s own migration handbook says that when the database and URLs stay the same, you can move the site by copying the files and database. If the database name or user changes on the new host, edit wp-config.php to match. A site that keeps its address needs no search-and-replace on the database.
That matters because search-and-replace is where many moves go wrong. The same handbook warns that some themes and widgets store values with the length of the URL recorded, so a plain find-and-replace across the database can break that serialized data. If you do have to change URLs (a new domain, or a move from a subfolder), use a tool that handles serialized data. WP-CLI’s search-replace command is one: its documentation says it handles PHP serialized data, and it has a –dry-run option to preview changes first.
On the new host, before you import anything:
You need to see the new copy before visitors do. One option is a temporary URL from the host. WordPress’s handbook warns, though, that testing on a different address means temporarily changing the “siteurl” and “home” values in the database, and changing them back afterwards. That’s two more edits, each a chance for a mistake.
A hosts-file entry avoids this. It tells only your computer to load your real domain from the new server’s IP address, while everyone else still reaches the old server. The URLs never change, so the database you test is the one that goes live.
As an example, if the new server’s IP address were 203.0.113.10 (an address reserved for documentation), the lines would be:
203.0.113.10 example.com
203.0.113.10 www.example.com
On Windows, the hosts file is C:and has to be edited as an administrator. On macOS and Linux, it’s /etc/hosts. Remove the lines when you finish testing, or you’ll keep seeing the new server after the switch and won’t notice if something is wrong for everyone else.
Expect one warning while testing this way: the new server may not have a valid certificate for your domain yet. cPanel’s AutoSSL only includes domains that pass a domain control validation (DCV) test. Let’s Encrypt’s challenge types page explains that its common HTTP-01 check fetches a file from your domain over port 80, which can’t succeed while the public DNS still points at the old server. A certificate warning during hosts-file testing is normal. A warning after the switch is not.
Test the journeys that make money or generate leads, not just the homepage:
From the moment you copy the database, the two copies start to drift apart. Every order, comment, form entry, new user or edit on the old server is missing from the new one. For a brochure site, that drift doesn’t matter much: avoid editing for a day and copy the database again just before the switch.
For a WooCommerce store, membership site or booking system, plan a short freeze:
Move the database whole. WooCommerce’s guidance on backups and migrations with Subscriptions recommends keeping the database intact between hosts: move the database and files, then update wp-config.php. It warns that exporting and importing content separately risks problems such as saved payment tokens no longer working.
At your chosen quiet hour, make the DNS change: update the A record, or switch the nameservers. Then, as soon as the new server starts receiving traffic:
If your email is with Google Workspace, Microsoft 365 or another outside provider, the move shouldn’t change it. Your only job is to make sure the MX and related TXT records exist, unchanged, in whichever DNS zone is live after the switch.
If your email is hosted with your old web host and is moving too, it needs its own short plan:
WordPress sends its own email too: contact form notifications, order emails, password resets. If those stop after the move while your mailbox email still works, check the SMTP plugin settings and the SPF and DKIM records before anything else.
For the first day or two, some visitors and services will still reach the old server. Google’s hosting-move guide recommends:
4GoodHosting’s migration guide likewise says to keep the old host for a few days as a rollback.
Keeping the old server doesn’t mean leaving its copy fully active. There’s a trap here that’s specific to WordPress. WP-Cron, WordPress’s scheduler, runs due tasks whenever a page loads, according to WordPress’s cron documentation, and WordPress also documents how to run it from the server’s task scheduler instead. So the old copy can keep sending scheduled emails, running imports or processing renewals for anyone or anything still reaching it.
WooCommerce Subscriptions has a safeguard for cloned sites. Its documentation on staging sites and migrations explains that it switches off automatic payments and subscription emails when the site’s URL differs from the URL where it was first activated. In a host move that keeps the domain, the URL doesn’t change, so that check has nothing to catch, and both copies may behave as the live site.
Once DNS has settled and you’ve copied any late orders or entries across:
| What you see | Likely cause | First fix |
|---|---|---|
| “Error establishing a database connection” | wp-config.php still has the old database name, user, password or host | Update the four database settings |
| 500 Internal Server Error | An .htaccess rule or PHP setting the new server doesn’t support, or a different PHP version | Rename .htaccess to test, and match the PHP version |
| Posts return 404 errors but the homepage works | Permalink rewrites not set up on the new server | Re-save Settings > Permalinks |
| Images missing | The uploads folder didn’t copy completely | Copy wp-content/uploads again and compare file counts |
| Browser certificate warning | AutoSSL hasn’t run since the DNS switch, or a CAA record blocks it | Check SSL/TLS Status and the CAA records |
| Email stopped, or goes to spam | MX, SPF or DKIM records missing from the new zone | Restore the records and run Email Deliverability |
| Changes don’t show for some visitors | DNS still pointing some visitors at the old server, or a cache | Wait for the TTL to expire, and clear caching plugin and CDN caches |
| Duplicate scheduled emails or renewals | The old copy is still running its scheduled tasks | Disable cron and payments on the old copy |
If the site goes down completely after the switch and the cause isn’t obvious, our guide to what to do when your website is down maps each error message to the layer that failed. 4GoodHosting’s guide to opening a support ticket lists what to include in a ticket so the host can help faster: the domain, when it started and what changed, the exact error text or a screenshot, and the steps you’ve already tried.
If you’re moving a WordPress site to 4GoodHosting, its knowledgebase covers each stage of this guide:
After the move, its WordPress Toolkit guide shows how to clone the site to a staging copy in cPanel. That’s a safe place to make the PHP upgrade and test plugin updates you deferred during the move. 4GoodHosting has servers in Vancouver and Toronto, and its contact page lists 24/7 phone support at 1 866 708 4678, as well as live chat.
Not if the URLs stay the same and the new server is reachable and fast. Google’s hosting-move guide says a temporary drop in crawl rate right after a move is normal, followed by a steady increase over the next few days. Avoid the real risks: a test copy left blocking search engines, a firewall blocking Googlebot, and a Search Console verification that breaks when the old server goes.
Copying a typical small business site takes minutes to a few hours, depending on its size and the method. The move as a whole usually runs about a week: a few days to lower the TTL and test, a quiet hour for the switch, and a few days of overlap before the old server goes. DNS changes usually take a few hours, and up to about 24 hours worldwide.
No. The domain registration and the hosting are separate. You can move the site by changing DNS records or nameservers while the domain stays with its current registrar, and transfer the registration later if you want both with one provider.
Yes. Add the new server’s IP address and your domain to your computer’s hosts file, and your browser will load the new copy while everyone else still sees the old one. Unlike a temporary URL, this doesn’t require changing WordPress’s site address in the database.
It’s safer not to. Match the new server’s PHP version to the old one, confirm the moved site works, and then upgrade PHP on a staging copy. If something breaks, you’ll know whether the move or the upgrade caused it.
If your email is with an outside provider such as Google Workspace or Microsoft 365, nothing changes, as long as the MX and related records are in the live DNS zone after the switch. If your email is hosted with your old web host, create the mailboxes on the new host first, copy the messages, update every device’s settings, and check the old mailboxes for a few days while DNS updates.
About the author: This article was written by the team at 4GoodHosting, a Canadian web hosting company operating since 2002 with servers in Vancouver and Toronto.





