Skip to content
Arrow keys to move, Enter to open, Esc to closeAll results
Hosting · Guides

How to Migrate WordPress to a New Host With Minimal Downtime

An order-of-operations guide to moving WordPress to a new host: inventory, method choice, DNS timing, hosts-file testing, cutover, rollback and post-move checks.

Written by
WPresident Editorial
Topic
Hosting

Moving a WordPress site looks like a copying job. You take the files, take the database, put both on the new server and change DNS. The copy really is the easy part, and it is almost never where the downtime comes from. Downtime comes from the gaps between the steps: a database that kept changing after you copied it, a DNS answer that part of the internet still remembers, a certificate that cannot be issued until the domain already points at the new server, or an email system that quietly depended on the old host. Migrations rarely fail loudly during the transfer. They fail on Monday morning, when someone notices that Sunday’s orders are missing, the contact form goes nowhere or the company mailbox bounces.

The single most important idea in this guide is to stop thinking of a migration as a move and start thinking of it as two servers running side by side for a short while. You build a complete copy on the new host while the old site stays live and untouched. You prove the copy works by pretending DNS already points at it. You shrink the DNS cache window in advance. Then you spend your downtime budget on exactly one thing, the final database sync, during a write freeze that you have rehearsed and timed. Every technique in the rest of this post is a way of making that window smaller, safer or more reversible.

It helps to be honest about what “minimal downtime” can mean. For a brochure site that is edited a few times a week, you can reach no visible downtime at all: the old server keeps serving visitors until the very moment they begin arriving at the new one, and nobody notices a thing. For a store, a membership site or anything that accepts writes from visitors (orders, comments, sign-ups, form entries, bookings), there is an unavoidable cost. Whatever is written to the old database after your last copy has to be carried across or it is lost. No tool removes that trade-off. The good ones only shorten the window in which it applies, and the sections on freeze windows and rollback show you how to choose a policy you can live with.

This guide follows the order in which the work should happen. You inventory what the site really depends on, because the surprises are almost always outside WordPress itself. Then you choose a method, prepare the new server, copy the site, test it with a hosts-file override, plan the DNS timing, protect email and SSL, cut over, and keep a rollback ready.

Two ground rules run through everything below. First, change one thing at a time. A migration is a risky enough event on its own, so do not also upgrade PHP, switch themes, change the domain and update every plugin in the same weekend. When something breaks, you want exactly one suspect. Second, the guide assumes the domain name stays the same, because that is the lowest-risk version and it lets you avoid most database rewriting. Where a step differs when the URL changes, the text says so. Vendor dashboards are described by goal rather than by button label, because those screens change, and wherever a limit or plan feature matters, check the vendor’s current documentation instead of trusting any article, this one included.

Key points

  • Downtime comes from three gaps, not from the copy: data written after your last copy, DNS caches that still point at the old server, and trust problems such as certificates and IP allowlists.
  • Keep two servers serving a correct copy of the site at the same time, and test the new one with a hosts-file override before any DNS record changes.
  • Lower the DNS TTL at least one old-TTL period before cutover, change only the A and AAAA records, and leave MX records and nameservers alone unless you have no choice.
  • Use wp search-replace for any URL or path change, never a raw SQL REPLACE, because serialized data stores string lengths that plain replacement corrupts.
  • Keep the old site intact and read-only until the new one has survived real use; rollback is cheap only before the new site has taken its first write.

What actually moves, and where downtime really comes from

A WordPress site is not one thing. What you see in the browser is the output of at least six layers, and a migration plugin or a host’s migration service typically carries only two of them: the files and the database. Everything else either has to be recreated on the new host or stays where it is and has to be left alone. Most migration surprises come from forgetting that the other layers exist.

Start from the bottom of the stack in the figure. The database holds your posts, settings, users, orders and scheduled events, and it is the only layer that keeps changing while you work. The files are WordPress core, plugins, themes, must-use plugins, drop-ins and the uploads folder; they change rarely, which is why they can be copied early and again later. The web server and PHP layer is where most of the invisible differences live: rewrite rules, PHP version, extensions, memory and upload limits, and which cache sits in front. None of that is inside WordPress, so a perfect copy of WordPress can still behave differently on a server that is configured differently.

Above that sit the layers you reach through other control panels: the certificate and any CDN or firewall in front of the site, and DNS itself. Beside the whole stack live the things outside the server entirely: where email is hosted, what real cron jobs call your site, which payment providers send webhooks to it, and which third-party services allow-list the old server’s IP address.

With the layers in mind, you can see that “downtime” is three different problems wearing one name. The first is the write gap: any change made to the database after your last copy is missing from the new site. The fix is a short, planned freeze and a final sync. The second is the cache gap: until resolvers around the world expire the old DNS answer, some visitors reach the old server and some reach the new one. The fix is to lower TTLs in advance and keep the old server serving a correct, harmless copy while they drain. The third is the trust gap: the new server must present a valid certificate for your domain and satisfy anything that checks identity, such as an allow-listed IP address or a restricted API key. The fix is to prepare those before the switch, not after it.

None of the three is solved by copying faster, which shrinks only the freeze. That is why this guide spends as much time on DNS, certificates and email as on moving the data.

The layers behind one WordPress request

Visitors and DNS resolversCache the old answer until its TTL expires; you cannot clear them.
Edge: certificate, CDN, firewallCertificates and IP allowlists are tied to names and addresses, not to your files.
Web server and PHPRewrite rules, PHP version, extensions, memory and upload limits live here, outside WordPress.
WordPress filesCore, plugins, themes, mu-plugins, drop-ins and uploads. Copy early, copy again at cutover.
DatabasePosts, options, users, orders and scheduled events. The layer that keeps changing while you work.
Outside the serverEmail hosting, real cron jobs, payment webhooks and services that allow-list your IP.
A migration tool usually carries the files and the database; every other layer has to be recreated or deliberately left alone.

Take an inventory before you touch anything

The most valuable hour in a migration is the one you spend writing down what the site depends on. People skip it because the site “just runs WordPress”, and then spend the migration weekend rediscovering the things it also runs. Treat the inventory as a list of questions with written answers, so that you can compare the old and new hosts line by line.

Begin with what WordPress can tell you. If you have SSH on the old server and WP-CLI installed, a handful of commands produce most of the picture. Run them from the WordPress root.

$ wp core version
$ wp plugin list --fields=name,status,version
$ wp theme list --fields=name,status,version
$ wp db size --size_format=mb
$ wp db prefix
$ wp option get siteurl
$ wp option get home
$ wp cron event list
$ du -sh wp-content/uploads
$ ls -la wp-content wp-content/mu-plugins
$ crontab -l

The plugin and theme lists tell you what has to exist on the new host. The size figures tell you whether a plugin-based transfer is realistic and how long a copy will take. The scheduled events show what WordPress will try to run, and the real crontab shows what the server runs on its own, which no migration plugin carries across.

Look at the wp-content listing for files that are not plugins or themes. A file named object-cache.php or advanced-cache.php is a drop-in installed by a caching plugin or by the old host, and it may expect a service, such as Redis, that the new host does not provide. Anything in mu-plugins loads automatically, and hosts often place their own code there. Copying a host-specific must-use plugin to a different host is a classic source of fatal errors and odd behaviour.

Then write down what WordPress cannot tell you. Which DNS provider holds the zone, and what is every record in it. Where email is hosted. Which CDN or firewall sits in front. What redirects exist in server configuration rather than in a plugin. Which payment gateways, CRMs, forms and APIs call the site, and whether any of them restrict access by IP address. Finally, note how often the data changes: how many orders, comments or form entries arrive per hour at the busiest time. That number decides how strict your freeze must be, and it is the input you will need in the cutover section.

Choose the method: host service, plugin or manual transfer

There are three families of method, and the right one depends on three variables: what access you have, how large the site is, and how much the data changes while you work.

A host’s migration service is the lowest-effort route. Many hosts will move the site for you, either by connecting to your old site with a plugin and a token or by having staff copy the files and the database. Its strengths are that it is usually quick and that someone else handles server-specific details. Its limits are that you often cannot see what it did, it may move only files and the database, and it typically leaves email, DNS, SSL for an external domain and server cron jobs to you. Before you accept the offer, ask what exactly is included, whether you get a temporary URL or another way to test before DNS changes, and whether a second sync at cutover is possible.

Migration plugins package the site and rebuild it elsewhere, and they work with only wp-admin access. They are convenient, and they fail in predictable ways on large sites, because they run inside PHP and inherit its time, memory and upload limits. The next section covers the two main designs. Their weak point for minimal downtime is that most of them are all-or-nothing: a second sync at cutover means repeating the whole export and import, which is fine for a small site and painful for a large one.

Manual transfer means copying files with rsync or SFTP and moving the database with a dump and an import. It needs SSH, or at least shell-style access, on both servers, but it gives you the one capability that matters most for minimal downtime: you can sync the heavy files early, while the old site is live, and then sync only the changes at cutover. The database is then the only large step left inside the freeze.

A reasonable rule is to use the least manual method that still lets you control the final sync. If the site is small, wp-admin is all you have and the data barely changes, a plugin or the host’s service is fine. If the site is large, busy or unusual, learn the manual route, because it is the one that scales. Multisite networks, very large media libraries and sites with custom server rules belong firmly in the manual group, and any of them deserves a rehearsal first.

Which migration method fits

What access do you have, and how big or busy is the site?
wp-admin only, small site, host offers to migrate itLet the host copy it, then run your own verification checklist on the result.
wp-admin only, site fits within upload and time limitsUse a migration plugin, ideally an installer-style one you can run on the new host.
SSH or SFTP plus database access on both serversGo manual with WP-CLI, rsync and a database dump, so the final sync stays small.
Multisite, huge media library or custom server rulesManual only, after a full rehearsal. Packaging plugins are the wrong tool here.
Access and size decide the method; the need for a cheap final sync pushes large or busy sites toward the manual route.

Prepare the new host for parity, not for improvement

The aim of preparation is parity. The new server should behave like the old one closely enough that the site cannot tell the difference, and any difference you do want should arrive later as a separate change.

Start with PHP. Match the old server’s PHP minor version for the migration, even if the new host defaults to a newer one, and plan the upgrade as its own project once the site is stable. If you change PHP during the move, you will not know whether the host or the version caused a failure. Then compare extensions and limits. These commands show what the new server offers from the shell, and the Site Health screen in wp-admin reports the same facts for the web process, which can differ.

$ php -v
$ php -m
$ mysql --version
$ wp --info

Compare memory_limit, upload_max_filesize, post_max_size, max_execution_time and max_input_vars with the old values. Large page builders and large imports are the usual victims of a lower limit. Check the database engine and version too. Moving between MySQL and MariaDB, or across major versions, can produce import errors such as an unknown collation, and a dump from a newer MySQL often will not import into an older MariaDB unchanged.

Next, find out what the new host forbids or already does for you. Managed hosts commonly keep a list of disallowed plugins, often caching, backup or database tools that duplicate what the platform provides, and they may run their own page cache or object cache. Learn which, so that you can deactivate the duplicates deliberately. Confirm that you have the access your method needs and that outbound email works or that you will use an SMTP service. Check which web server software is running too. Moving from Apache with .htaccess files to nginx means every rule in .htaccess stops working silently: permalinks, redirects, security rules and caching rules.

Finally, create the empty containers: the database and its user, the document root for the domain, and a way to reach the copy before DNS changes. Then decide what the copy must not do while you test it. A copy of a live site carries scheduled events, newsletter queues and subscription renewals, and if it runs its own cron and sends its own mail while the old site is still live, customers receive duplicate messages. Block outbound mail and disable WP-Cron on the copy until cutover.

Migration plugins: installer-style and export-import designs

Migration plugins package the site, move the package, and rebuild it. They differ in design more than in brand, and the design decides where they break.

The installer style, of which Duplicator is a well-known example, builds an archive of the files plus a database export and a small installer script on the source site. On the new host you create an empty database, upload the archive and the installer to an empty document root, and open the installer in a browser. It extracts the files, imports the database and can rewrite URLs and paths. Its strengths are that the target does not need WordPress installed and that the process runs in visible stages with preflight checks. Combined with a hosts-file override, you can run it against the real domain, which means no URL rewriting at all. Its weakness is the leftovers: the installer and the archive contain a full copy of the site and database access details, so remove them from the web root the moment you finish.

The export-import style, of which All-in-One WP Migration is a well-known example, works the other way round. You install a fresh WordPress and the same plugin on the target, then import a single export file through wp-admin. It is simple, with no installer script and no hand-built database. The import travels through the browser and PHP, so upload size, post_max_size, execution time and web server request limits all apply. Vendors have historically capped import size in free tiers and sold extensions that lift the cap, so check the current vendor page before assuming a large site will import. Two behaviours catch people out: the import replaces the target’s content including user accounts, so you log in afterwards with the source site’s credentials, and you should re-save permalinks once it completes.

Either way, reduce the package before you build it. Exclude cache folders and the backup archives other plugins store inside wp-content, or you will move gigabytes of material nobody needs. If a package stalls at a percentage, returns a request-too-large error or times out, the usual remedy is to exclude the uploads folder from the package and move it separately with SFTP or rsync, which is the first step toward a manual migration. Plugins also leave you with the all-or-nothing problem described earlier: the final sync at cutover means building and importing a second full package. Time a rehearsal run, and use that figure as your freeze window.

duplicator.com
The Duplicator plugin page describing its backup and migration features for WordPress.
Duplicator is a well-known installer-style migration plugin; check the vendor page for what the current version includes.

The manual route with WP-CLI and rsync

The manual method looks intimidating and is mostly a handful of commands. Its advantage is the two-pass pattern: copy everything while the old site is live, then copy only the changes during the freeze. The example uses a made-up domain and servers; substitute your own paths and user names. Run the first pass from the new server so that it pulls from the old one.

$ rsync -az --progress --exclude='wp-content/cache/' deploy@old.example.net:/var/www/example.com/ /var/www/example.com/
$ ssh deploy@old.example.net 'cd /var/www/example.com && wp db export /tmp/example-pass1.sql'
$ scp deploy@old.example.net:/tmp/example-pass1.sql /tmp/example-pass1.sql
$ cd /var/www/example.com
$ wp config set DB_NAME example_wp
$ wp config set DB_USER example_user
$ wp config set DB_PASSWORD 'replace-with-a-long-random-password'
$ wp config set DB_HOST localhost
$ wp db import /tmp/example-pass1.sql
$ wp db check

A few details matter. The trailing slashes in the rsync command mean “the contents of this directory”, and getting them wrong nests a second copy of the site inside the first. Add --dry-run to the first run if you are unsure. The wp config set commands edit the copied wp-config.php to point at the new database, which is safer than rewriting the file by hand. After the import, wp db check confirms that the tables are readable.

The first pass is now your rehearsal. Point your hosts file at the new server, as described a little later, and browse the copy. This is the moment to discover the missing PHP extension or the lost nginx rule, while nobody is waiting.

At cutover you repeat the same steps with less data. Rsync moves only what changed, which for a large uploads folder is usually a short job. The database is exported again after the old site is frozen, and the export includes drop-table statements so that the import replaces the tables from pass one.

$ rsync -az --progress --exclude='wp-content/cache/' deploy@old.example.net:/var/www/example.com/ /var/www/example.com/
$ ssh deploy@old.example.net 'cd /var/www/example.com && wp db export /tmp/example-final.sql --add-drop-table'
$ scp deploy@old.example.net:/tmp/example-final.sql /tmp/example-final.sql
$ cd /var/www/example.com
$ wp db import /tmp/example-final.sql

Two housekeeping points finish the job. Delete the dump files from both servers afterwards, because a database export contains personal data and password hashes. And check file ownership: if rsync ran as root, the files may belong to root, and WordPress will then fail to write to the uploads folder. The post-migration section shows how to spot and fix that.

Search-replace and serialized data: changing URLs without corrupting settings

If the domain, the scheme and the file paths are identical on both servers, you can skip this section entirely. That is the best reason to keep the domain unchanged and to test with a hosts-file override: the database never needs rewriting. You need search-replace when you test through a temporary address, when you move from http to https or between www and the bare domain, or when plugins stored absolute server paths such as the old account’s home directory.

The danger is serialized data. WordPress and many plugins store arrays and objects in the database as PHP serialized strings, and each string records its own length. A value containing your address looks like s:23:"https://old.example.com", where 23 is the number of characters. If you replace the text with a plain SQL REPLACE or a find-and-replace in a dump file, the text changes but the 23 does not. PHP then refuses to unserialize the value, and the setting silently resets or vanishes: a widget area, a theme customizer value, a plugin’s whole options array. Nothing errors at the time.

WP-CLI avoids this by unserializing each value, replacing inside it, and serializing it again with correct lengths. Always take a fresh export first, run a dry run, read the report, and only then run it for real.

$ wp db export /tmp/example-before-replace.sql
$ wp search-replace 'https://old.example.com' 'https://example.com' --all-tables-with-prefix --skip-columns=guid --dry-run
$ wp search-replace 'https://old.example.com' 'https://example.com' --all-tables-with-prefix --skip-columns=guid --report-changed-only
$ wp cache flush
$ wp option get siteurl
$ wp option get home

The --skip-columns=guid flag leaves the post GUID column alone. A GUID is meant to be a permanent identifier that feed readers use to recognise an item, and it should not change when the address does. The prefix flag keeps the command away from unrelated tables in a shared database.

Read the dry-run report as evidence. Replacements should appear in the options, posts and post meta tables at least. A count of zero when you expected hundreds usually means the text is stored in a different form. Some page builders keep their layout data as JSON, where the slashes in an address are escaped, so searching for the plain address misses them. Run the dry run again for the slash-escaped form, and check whether your builder offers its own URL replacement tool. Run separate passes for the www variant, for protocol-relative addresses and for absolute server paths, using the old and new directory names.

Finally, remove any WP_HOME or WP_SITEURL constants you added to wp-config.php for testing, because they override the database values and hide mistakes.

Raw replacement versus wp search-replace

Raw SQL REPLACE or text editorwp search-replace
Serialized valuesText changes, stored length does not, value becomes unreadableUnserializes, replaces, reserializes with correct lengths
Nested arrays and objectsBreaks silently, no warningWalks into nested data
PreviewNone; you find out afterwardsDry run reports changes per table and column
Scope controlWhatever you pointed it atChoose tables, prefix or skip columns such as guid
Serialized values record their own length, so only a tool that rewrites them correctly is safe on a WordPress database.

Test the copy with a hosts-file override before DNS changes

The most useful trick in this whole process costs nothing. Your computer consults a local file called the hosts file before it asks DNS. If that file says the domain lives at the new server’s address, then your machine, and only your machine, reaches the new server using the real domain name, while every other visitor still reaches the old one. The copy is therefore tested under the exact conditions it will face at launch, with the same host name, the same URLs in the database and no rewriting.

On Windows the file is C:\Windows\System32\drivers\etc\hosts, and on macOS and Linux it is /etc/hosts. Edit it with administrator rights and add a line with the new server’s address followed by the names. The address below belongs to a range reserved for documentation, so replace it with your server’s real one.

203.0.113.10 example.com www.example.com

Confirm that you are really on the new server before you judge anything. Curl can do the same without editing the file, and it proves both schemes answer.

$ curl -sI --resolve example.com:443:203.0.113.10 https://example.com/
$ curl -sI --resolve example.com:80:203.0.113.10 http://example.com/

Browsers can defeat the override. They cache DNS answers, and some use encrypted DNS that bypasses the system resolver, so if the old site keeps appearing, try a private window, restart the browser or turn off secure DNS for the test. If the new server has no certificate for the domain yet, the browser will warn you, and curl will refuse unless you add its insecure flag for the test. Treat that warning as a to-do item, because the certificate must exist before cutover. Remove the hosts line when you finish, or you will confuse yourself later.

Test what visitors and editors do, not just the home page. Log in, publish a draft, upload an image, run the search, load a deep page and submit each form. If the site sells things, put the payment gateway in its test mode first. Remember that the payment provider’s webhooks go to the real domain, which still resolves to the old server, so the copy never sees them, and a full end-to-end payment test is only possible after cutover.

How a hosts-file override routes your test traffic

  1. Browser asks for example.comThe operating system checks the hosts file before it asks DNS.
  2. Hosts file returns the new addressOnly this computer is redirected; the rest of the world still resolves the old address.
  3. Connection goes to the new serverThe request still carries the host name example.com, so the right site answers.
  4. New server presents a certificateWithout one for the domain you see a warning. Fix it before cutover.
  5. WordPress serves the copyURLs in the database already match, so no search-replace was needed.
Only your machine is redirected, so you test the new server under the real domain while everyone else keeps using the old one.

TTL and DNS timing: what propagation really is

“DNS propagation” suggests that a change spreads outward from your DNS provider like a wave. Nothing is pushed anywhere. Resolvers around the world cache each answer for the number of seconds in its TTL, and when that time expires they ask again. After you change a record, every resolver keeps handing out the old answer until its own cached copy runs out. The worst case is therefore the old TTL, not the new one, and that single fact drives the whole schedule.

Lowering a TTL does not affect copies that are already cached. A resolver that fetched your record an hour ago, with a TTL of one day, will keep it for another 23 hours whatever you do now. So the TTL must be lowered at least one full old-TTL period before the cutover, so that by the time you switch, every cache holds a short-lived copy. Find the current values by asking your authoritative name servers directly, which shows the configured TTL rather than a resolver’s countdown.

$ dig +short NS example.com
$ dig @ns1.example-dns.net example.com A +noall +answer
$ dig @ns1.example-dns.net www.example.com +noall +answer
$ dig @ns1.example-dns.net example.com AAAA +noall +answer

A few minutes, for instance 300 seconds, is a common choice for the cutover period. Providers and registrars set their own minimums, and some resolvers apply a floor of their own, so expect a thin tail of visitors who reach the old server for longer than the TTL suggests. That tail is why the old server must stay up and serve a correct copy for a while.

Which record you change matters as much as when. Changing an A record at your existing DNS provider is governed by that record’s TTL, which you control. Changing the name servers at the registrar is governed by the delegation records held at the top level of the domain, which commonly have long lifetimes outside your control, and it moves the entire zone, so every record, including mail, has to be duplicated first. Prefer to change only the A and AAAA records. If a host insists on taking over your name servers, copy the complete zone, query the new name servers directly to confirm every record answers, and only then change the delegation.

If the site already sits behind a proxy-style CDN, visitors resolve the CDN’s addresses, not yours, so repointing the origin takes effect at the CDN almost at once. Make sure the origin has a valid certificate for the mode the CDN uses first. Once the new site is stable, raise the TTLs back to your normal values.

DNS timing around a cutover

Days beforeRecord every DNS record and its TTL. Note the longest TTL on the A, AAAA and www records.
One old TTL beforeLower the TTL on the records that will change, so caches holding the long value can expire.
Before the freezeFinish hosts-file testing, install the certificate and verify the first full copy.
FreezePut the old site in maintenance mode, take the final database export and sync changed files.
SwitchImport on the new server, verify via the hosts file, then change the A and AAAA records.
First hourWatch both access logs. Stale visitors still reach the old server, which stays read-only.
When stableRaise the TTL again, re-enable normal cron and mail, and keep the old server for rollback.
Every step is relative to the old TTL, because the old TTL, not the new one, sets how long stale answers survive.

Email, DNS records and SSL: the two failures nobody sees coming

Email and certificates fail quietly, because the website looks fine while they are broken. Take email first. Mail does not live where the website lives. MX records say where incoming mail is delivered, and they stay exactly as they are when only the web server moves. The trap is the DNS zone itself. If your name servers belong to the old host, as they often do on cPanel-style accounts, then closing or changing that account takes the zone, MX records included, along with it. That is the main reason to change only the A and AAAA records at the existing DNS provider. If the mailboxes themselves sit at the old host, moving the site does not move them. Mail migration is a separate job with its own tools, and the old mail service stays until it is done.

Outgoing mail from WordPress is the second half. Form notifications and password resets leave through PHP mail on the new server or through an SMTP service. SPF lists the servers allowed to send for your domain, DKIM signs messages with keys the sending service holds, and DMARC tells receivers what to do when checks fail. If the sending path changes, review all three records. The cleaner design is to send site mail through a dedicated SMTP or transactional email service, so that deliverability stops depending on any web host and the migration cannot disturb it.

Walk the whole zone, record by record, instead of trusting memory. The figure lists the usual suspects. Two deserve emphasis. An AAAA record left pointing at the old server’s IPv6 address silently keeps IPv6 visitors on the old site long after you changed the A record. A CAA record that names a specific certificate authority can stop the new host from obtaining its certificate.

Now certificates. A certificate is bound to names, not to servers, and the new host must hold a valid one for the bare domain and for www before visitors arrive. The awkward part is that automatic issuance through an HTTP challenge needs the domain to already point at the new server, which has not happened yet. You have a few ways out: ask the host to validate through DNS by adding a TXT record, import the existing certificate and key if the old host lets you export them, use the host’s automatic issuance immediately after the switch and accept a brief gap, or use a CDN’s origin certificate if you run behind one.

Check HSTS before choosing. If the old site has been sending a strict-transport-security header with a long lifetime, browsers that saw it will refuse to connect when the certificate is missing or wrong, and they offer no click-through. An unready certificate then becomes a hard outage for returning visitors.

DNS records at cutover

What to do at cutoverWhy it matters
A and AAAA, apex and wwwRepoint to the new serverA leftover AAAA keeps IPv6 visitors on the old server indefinitely
MXLeave unchangedMail routing does not depend on where the website runs
SPF, DKIM, DMARCReview if the sending path changesSite mail from a new server can fail authentication
CAACheck before requesting a certificateIt can forbid the new certificate authority
Subdomains such as webmailKeep; repoint only what really movesA record to the old IP breaks the day the old server closes
Name serversLeave at the current providerMoving the zone means copying every record first
Change only what must change; most records stay exactly as they are.

Cutover day: freeze windows, orders and background jobs

The cutover is a short sequence with one critical moment: the final database export. Everything written to the old database before that moment travels to the new site, and everything written after it is lost or has to be replayed. Your rehearsal told you how long the export, transfer and import take. That number is the freeze window, and it is the only downtime you are choosing to accept.

The policy depends on what the site does. A brochure site or blog only needs editors to stop publishing and comments to pause. Visitors can keep reading the old site throughout, so no maintenance page is needed at all. A store needs more care. Choose between a short maintenance page with a 503 status while you export and import, or a read-only mode where browsing continues and checkout is paused. After the switch, stale DNS means some customers still reach the old server, and an order placed there lands in a database nobody reads. So put the old store into maintenance after the final export. Visitors with a stale cache then see a short notice instead of silently losing an order.

$ wp maintenance-mode activate
$ wp maintenance-mode status
$ wp maintenance-mode deactivate

Check that whatever you use returns a 503 status, not a normal 200 page, so that search engines treat the outage as temporary.

Background jobs are the quiet risk. Scheduled actions, subscription renewals, abandoned-cart emails and newsletter queues live in the database, so both copies hold them. They must run on exactly one server. Keep WP-Cron off on the copy until the switch, then turn it on there and make sure it is off on the old server.

$ wp config set DISABLE_WP_CRON true --raw
$ wp config delete DISABLE_WP_CRON

Run the first command on the copy while testing, and the second after cutover. Subscription plugins sometimes detect a changed site address and pause renewals as duplicate-site protection, so read the documentation of yours.

Three more things belong on the checklist. Add the new server’s outbound IP address to every allowlist that guards a payment, shipping or API service before the switch. Place a real test order after the switch, since webhooks could not be tested earlier. And afterwards compare the order count on the old site with the new one, and reconcile against the payment provider’s own records for the window. Choose the lowest-traffic hour from your analytics, not the most convenient one.

The cutover sequence

  1. Freeze writesStop editors and pause checkout or comments, as your site requires.
  2. Old site to maintenanceReturn a 503 so stale visitors cannot place orders into a dead database.
  3. Final export and file deltaDump the database, then sync only the files that changed since pass one.
  4. Import and verifyUse the hosts-file override to check login, pages and checkout on the new server.
  5. Switch A and AAAAChange only the records that move; MX stays as it is.
  6. Enable cron and mail on the new siteMake sure scheduled jobs run on one server only.
  7. Watch both serversRead the access logs until the old server stops receiving real traffic.
The final database export is the real cutover; everything after it must be reproducible on the new server.

Rollback: a plan you can follow when you are under stress

Write the rollback plan before the cutover, because nobody thinks clearly at the moment something goes wrong. A rollback means pointing DNS back at the old server, and it works only if the old site still holds current, complete data. That gives you the key insight: there are two phases. Before the new site has taken its first real write, rollback is cheap. You change the records back, the short TTL makes it quick, and nothing is lost. After the new site has taken orders, comments or registrations, the two databases have diverged, and going back means either losing those writes or carrying them back by hand. From that point you normally fix forward, unless the new site is truly unusable.

So agree the triggers in advance. Decide which failures mean “go back”, such as checkout failing, logins broken or data visibly missing, and which mean “fix in place”, such as a missing image size or a slow first page load. Name who decides and by when. A rule like “if checkout is still failing an hour after the switch, we revert” is worth more than a general intention to be careful.

Keep the old environment intact for longer than feels necessary. Do not cancel the old hosting on the day of the switch. Keep it until the new site has been through a full cycle of the things that happen only now and then: a scheduled backup, a newsletter send, a recurring payment run, a month-end report. Some failures only appear then. Leave the old site read-only, with cron and outgoing mail off, so that it cannot send duplicate messages or accept orders. Remember that a host usually deletes your backups when you close the account, so anything you may still need has to exist somewhere else first.

That is where an independent backup earns its place. Before you start, take a full backup of the files and the database, store it off both servers, and prove that it restores. A backup plugin such as UpdraftPlus does this job, and its paid tier has been marketed with migration features as well, so check what the current plan includes before relying on that. Run a backup on the new host soon after the switch too, to prove it can create and store them.

When you are confident, delete the old copy and the dump files, remove old SFTP and SSH access, and rotate the database password and any API keys that sat in the old configuration.

updraftplus.com
The UpdraftPlus backup plugin page describing scheduled backups and restores for WordPress.
A backup plugin such as UpdraftPlus gives you a restorable copy stored away from both servers; confirm current features on the vendor page.

Work through these checks in order, because each can hide the next. Do them with the hosts-file override first and again after the DNS switch.

If the home page loads but inner pages return 404, the rewrite rules did not survive. On Apache, check that the rewrite module and .htaccess overrides are allowed. On nginx, the server block needs a try_files rule that falls back to index.php. Then regenerate the rules WordPress controls.

$ wp rewrite flush --hard
$ wp option get blog_public
$ wp cron event run --due-now
$ wp core verify-checksums
$ wp plugin verify-checksums --all

The second command prints 1 when search engines are allowed. A value of 0 means the site discourages indexing, often a leftover from a staging copy. The cron command runs overdue events, and the checksum commands compare core and plugin files with the official ones, which catches files damaged or missing in transfer.

A redirect loop in the browser right after the switch usually means WordPress cannot tell that the visitor arrived over HTTPS, because a proxy or load balancer in front of the server terminates it. Where the proxy sets the standard forwarded-protocol header, this snippet in wp-config.php, above the line that says to stop editing, fixes it. Add it only if that is truly your setup, since many hosts already do it for you.

if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
    $_SERVER['HTTPS'] = 'on';
}
  • Mixed content: the padlock shows a warning or images are missing. Open the browser console, find the http address, and run another search-replace pass for it.
  • Upload errors such as “unable to create directory”: ownership or permissions. Files should belong to the user PHP runs as. Directories at 755 and files at 644 are the usual baseline, which you can apply with the find commands below.
  • Scheduled posts missed: the old host may have used a real server cron with WP-Cron disabled. Recreate that job, or remove the constant so WP-Cron works again.
  • Stale or conflicting caches: purge the plugin cache, the host’s page cache, the object cache and any CDN, and remove drop-ins that expect services the new host lacks.
  • Forms: submit each one and confirm the mail arrives, including the spam folder.
$ find /var/www/example.com -type d -exec chmod 755 {} +
$ find /var/www/example.com -type f -exec chmod 644 {} +

Finally, check that robots.txt does not block everything, the sitemap loads, and analytics and uptime monitoring point at the new site. If a white screen or critical error appears, enable debug logging and read the log before changing anything else.

Checklist

  • Write down every plugin, theme, mu-plugin and drop-in on the old site, plus real server cron jobs and server-level redirects.
  • Export the full DNS zone with every record and its TTL, and note where email is hosted.
  • Take a full off-server backup of files and database and prove it restores somewhere.
  • Match the old PHP version, extensions, memory and upload limits on the new host; upgrade PHP later.
  • Lower the TTL on the A, AAAA and www records at least one old-TTL period before cutover.
  • Block outgoing mail and disable WP-Cron on the copy until cutover.
  • Complete a full copy and test it through a hosts-file override: login, editing, uploads, search and forms.
  • Run wp search-replace with a dry run first if any URL, scheme or path changes, and never use raw SQL REPLACE.
  • Have a valid certificate for the bare domain and www ready on the new host, and check CAA records and HSTS.
  • Add the new server’s outbound IP to every payment, shipping and API allowlist.
  • Rehearse the final export and import and write down the freeze time.
  • Put the old site in maintenance mode (a 503 response) before the final database export.
  • Change only A and AAAA records at cutover; leave MX records and name servers alone.
  • Place a real test order after the switch and reconcile orders against the payment provider’s records.
  • Run the post-move checks: permalinks, mixed content, uploads, cron, caches, forms and robots.txt.
  • Keep the old server read-only until a full cycle of recurring jobs has run, then delete dumps and rotate credentials.

About this guide. This is general guidance written by WPresident Editorial from documentation and widely used practice. WPresident has not benchmarked the products or methods described. Interfaces and plan limits change, so check the vendor’s current documentation before you act. Not legal, tax or financial advice. See our editorial policy.

Frequently asked questions

How much downtime should I expect when moving WordPress?

It depends on how much the site writes. A brochure site can move with no visible downtime, because the old server keeps serving until visitors arrive at the new one. A store or membership site has a short write freeze around the final database export. Rehearse the move once and time it; that figure is your realistic freeze window for the real cutover.

Do I need to lower the TTL before migrating?

Yes, if you want a fast, controllable switch. Lower the TTL on the records that will change at least one full old-TTL period before cutover, because caches holding the old long value keep it until it expires. A few minutes is a common choice. Expect a small tail of stale visitors anyway, so keep the old server running for a while.

Do I need search-replace if the domain stays the same?

Usually not at all. If the domain, scheme and paths are identical on both servers, the database already contains the right values. You need it when you test through a temporary address, change between http and https or www and the bare domain, or when plugins stored old server paths. Use wp search-replace with a dry run first, never raw SQL.

What happens to my email when I move the website?

Nothing, as long as the MX records stay unchanged and the DNS zone stays where it is. Email breaks when the name servers belonged to the old host and the zone disappears with the account. Change only the A and AAAA records at the current DNS provider. Review SPF and DKIM if site mail will now be sent from a different server.

Should I use a migration plugin or the host's free migration?

A host service is the least effort, but ask what it covers, because email, DNS, cron jobs and external-domain SSL are often left to you. A plugin works with nothing more than wp-admin but inherits PHP limits on large sites. For big or busy sites, the manual route with rsync and a database dump gives you the smallest possible final sync.

How can I test the new server before DNS changes?

Add a line to your computer's hosts file mapping the domain to the new server's IP address, or use curl with its resolve option. Only your machine reaches the new server, using the real domain name. If the old site still appears, clear the browser's DNS cache, try a private window or turn off encrypted DNS in the browser settings.

How do I avoid losing WooCommerce orders during the move?

Freeze writes, put the old store in maintenance mode, take the final database export, import it on the new server, verify, then switch DNS. Keep the old store in maintenance so stale-DNS customers cannot order into a database nobody reads. Afterwards compare order counts and reconcile with the payment provider's records for the window. Test a real order after the switch.

Why do I still see the old site after changing DNS?

Usually a cache. Resolvers keep the old answer until its TTL expires, your browser and operating system keep their own copies, and a leftover hosts-file line forces the old or new address on your machine. Check from another network or device, query the authoritative name servers directly with dig, and look for a forgotten AAAA record pointing at the old server.

How long should I keep the old hosting account?

Longer than feels necessary, in most cases. Keep it until the new site has been through a full cycle of recurring events: a scheduled backup, a newsletter, renewals, month-end jobs. Hosts usually delete your backups when you close an account, so store an independent backup first. Keep the old site read-only, with cron and mail disabled, until you finally delete it.

Can I upgrade PHP or update plugins during the migration?

Avoid it. Match the old PHP version, plugin versions and settings for the move, then upgrade afterwards as a separate step. If you change several things at once and something breaks, you cannot tell whether the new host, the new PHP version or an updated plugin is responsible. Making one change at a time keeps the cause obvious and the fix quick.

W
Written byWPresident EditorialThe WPresident editorial team. Every article says whether it comes from hands-on use or from documentation, and anything paid for is labelled.

Keep reading

Hosting

The Best WordPress Hosting in 2026

Choose WordPress hosting by model, not logo: shared, managed or cloud, plus caching, PHP workers, staging, backups and support. Eight hosts profiled, no hype.

Read more
WPresident Editorial

Get the Monthly Launch Report

One email a month: the best of last month's articles, new reviews and what changed in WordPress, without the noise.

No spam. Unsubscribe in one click.

Signed and sealed,
The WPresident
↑↓ move↵ openEsc closeAll results