WordPress guides

How to migrate a WordPress site to a new host without downtime

Migrating a WordPress site to a new host

Migrating a WordPress site to a new host takes six stages: prepare (inventory, backup, lower TTL), copy the files and database, test the new server before the public sees it, switch DNS, check, and only then cancel the old hosting. Done properly, the migration causes no downtime and changes nothing for SEO. This guide gives you the timeline, the commands for the manual method, what hosts will do for you for free, and the rollback plan.

Looking to create a copy of the site (staging, template site) rather than move it? That is covered in our guide to duplicating a WordPress site. Not chosen the new host yet? Start with our WordPress hosting comparison.

The timeline of a zero-downtime migration

The classic mistake is doing everything on the same day. The new server must be ready and tested before DNS points to it, and the old one must stay live for a few days afterwards. The animation shows the recommended sequence.

Timeline of a WordPress migrationSix steps light up in order: inventory a week before, TTL lowered two days before, files and database copied the day before, new server tested through the hosts file, DNS switch on the day, checks with the old hosting kept for a week.1D-7: inventoryMethod, DNS, email, cron jobs, server rules2D-2: lower the TTL300 seconds on the A and AAAA records3D-1: copyFiles and database, content frozen during the copy4D-day: hidden testNew server opened through the hosts file, SSLready5D-day: DNS switchVisitors move to the new server6D+1 to D+7: checksOld hosting kept so you can roll backTimeline of a WordPress migrationSix steps light up in order: inventory a week before, TTL lowered two days before, files and database copied the day before, new server tested through the hosts file, DNS switch on the day, checks with the old hosting kept for a week.1D-7: inventoryMethod, DNS, email, cron jobs, serverrules2D-2: lower the TTL300 seconds on the A and AAAArecords3D-1: copyFiles and database, content frozenduring the copy4D-day: hidden testNew server opened through the hostsfile, SSL ready5D-day: DNS switchVisitors move to the new server6D+1 to D+7: checksOld hosting kept so you can roll back

Prepare: inventory, backup and TTL

A migration rarely fails because of WordPress, almost always because of something forgotten around it. Before touching anything, list everything that has to move.

What has to move with the siteSeven items to plan: files, database, DNS zone, email, SSL certificate, server scheduled tasks, web server rules.Fileswp-content, wp-config.php, .htaccess, files at therootDatabaseFull export, same encoding (utf8mb4)DNS zoneA, AAAA, CNAME, MX, TXT (SPF, DKIM, verifications)EmailMailboxes to recreate and copy if the host ranthemSSL certificateIssued on the new server before or right after theswitchServer cron jobsBackups, real WordPress cron, scriptsWeb server rulesApache and LiteSpeed read .htaccess, Nginx doesnotWhat has to move with the siteSeven items to plan: files, database, DNS zone, email, SSL certificate, server scheduled tasks, web server rules.Fileswp-content, wp-config.php, .htaccess,files at the rootDatabaseFull export, same encoding (utf8mb4)DNS zoneA, AAAA, CNAME, MX, TXT (SPF, DKIM,verifications)EmailMailboxes to recreate and copy if thehost ran themSSL certificateIssued on the new server before orright after the switchServer cron jobsBackups, real WordPress cron, scriptsWeb server rulesApache and LiteSpeed read .htaccess,Nginx does not
  • Full backup stored away from both servers, with a restore already tested (our 3-2-1 backup method).
  • Versions: PHP and MySQL or MariaDB at least as recent on the new server, same PHP extensions (imagick, intl, redis if used).
  • DNS zone: export or copy every record, not just the A record. A forgotten MX or TXT record cuts email or breaks a verification (Search Console, SPF).
  • TTL: 24 to 48 hours before the switch, lower the time to live of the A and AAAA records to 300 seconds. Resolvers will forget the old address within five minutes instead of several hours, which also makes a rollback fast.

Three ways to copy the site

MethodFor whomCostWatch out for
Host’s migration serviceEveryone, as a first choiceOften freeLead time, access to hand over
Plugin (All-in-One WP Migration, Duplicator, Migrate Guru)Small and medium sites, no SSHFree to a few dozen dollarsUpload limit, archives to delete
Manual (SFTP or SSH, mysqldump, WP-CLI)Large sites, developersFreeRequires comfort with the command line

The host’s migration service

Many hosts migrate your site for free, because it is a selling point. o2switch advertises a free migration for sites hosted elsewhere (see our o2switch review). Hostinger offers a migration request in hPanel, using the site’s WordPress login or backup files; its documentation states that email is not part of the migration and that you must disable two-factor authentication and anti-bot checks that would stop its team from logging in (see our Hostinger review). Kinsta advertises free, unlimited migrations for standard WordPress installs. SiteGround provides the free SiteGround Migrator plugin: a token generated in Site Tools, and the site is copied with a temporary test address valid for 48 hours.

Rather than disabling your protections for the migration team, prefer the backup-file method when it exists, or create a temporary administrator account that you delete right after, giving the site’s real login address if you have moved it.

With a plugin

All-in-One WP Migration, Duplicator, WPvivid or Migrate Guru do the job without a command line; our duplication guide compares their limits and prices. For a migration without an address change, Migrate Guru is the most comfortable on a large site: it copies from server to server without going through your computer.

The manual method

With SSH on both servers, the copy takes a few commands. Account names, database names and the IP address are examples.

# Old server: database and files
mysqldump --single-transaction --default-character-set=utf8mb4 -u user -p dbname > site.sql
tar -czf site.tar.gz -C /home/account/www .

# New server: fetch, extract, import
rsync -avz old:/home/account/site.sql old:/home/account/site.tar.gz ~/
tar -xzf ~/site.tar.gz -C ~/www
cd ~/www
wp config set DB_NAME new_db
wp config set DB_USER new_user
wp config set DB_PASSWORD 'password'
wp db import ~/site.sql
wp rewrite flush

# Only if the site address changes
wp search-replace 'https://old-domain.com' 'https://new-domain.com' --skip-columns=guid --dry-run

Without SSH, download the files over SFTP and export the database from phpMyAdmin, then import them the same way. Delete site.sql and the archive afterwards: they contain the whole database, hashed passwords included.

Test the new server before the switch

Your computer’s hosts file lets you open the site on the new server, at its real address, while the rest of the world still sees the old one. Add a line with the new server’s IP address, then remove it after testing.

# Windows: C:\Windows\System32\drivers\etc\hosts (editor run as administrator)
# macOS and Linux: /etc/hosts
203.0.113.10  example.com www.example.com
  • Browse the key pages, log in, submit a form, place a test order.
  • The HTTPS certificate: Let’s Encrypt can only validate the domain once DNS points to the server. If the host does not offer early issuance, expect a few minutes without a valid certificate right after the switch, or use DNS validation.
  • Check that the server rules work: redirects, security headers, blocked paths.

The switch and post-migration checks

For a site that takes orders or comments, freeze content during the final sync: maintenance mode, fresh database export, import, then change the DNS records. Otherwise, orders placed on the old server during propagation will be lost. Check propagation with dig +short www.example.com or an online DNS checker.

CheckHowIf it fails
Pages and permalinksHome, posts, deep pagesSave Settings, Permalinks; check .htaccess or the Nginx config
Site emailsForm, lost password, orderSMTP, SPF and DKIM records for the new server
Scheduled tasksBackups, scheduled postsRecreate the server cron jobs
PaymentsTest order, webhooksUpdate webhook URLs if the domain changes
PermissionsUpload an image, update a pluginFix owner and permissions (644 and 755)
CDN and proxyCloudflare or another in front of the siteChange the origin address, purge the cache

SEO: same address or new domain

Same address: changing host without changing URLs requires no declaration to Google. Just watch the Search Console crawl stats over the following days: a rise in server errors or response times points to a configuration problem. A faster server may even improve Core Web Vitals.

New domain: this is a change of address, far more sensitive. Every old URL must point with a 301 redirect to its new equivalent (not everything to the home page). Then declare the move with Search Console’s Change of Address tool, which requires you to own both properties. Google advises keeping the redirects for at least 180 days, and keeping the old domain registered for at least a year. Moving from HTTP to HTTPS or between the www and non-www versions does not use this tool.

The rollback plan

  • Do not cancel the old hosting before a week of normal operation, and check its renewal date before you start.
  • Write down the old DNS values: with a 300-second TTL, rolling back takes a few minutes.
  • Decide in advance the rollback threshold (site down for more than an hour, failing payments) and who makes the call.
  • After a rollback, orders and sign-ups received on the new server must be carried over by hand.

WP Feint after a change of host

WP Feint’s settings live in the database and follow the site. What depends on the server must be reviewed.

  • Apache and LiteSpeed to Nginx: Nginx ignores .htaccess files. The plugin folder is then no longer hidden by its own file: add the rule given in the documentation to the server configuration. Pro’s file aliases and any .htaccess blocks must also be translated into Nginx rules (see protecting wp-admin at server level).
  • Site path changed: if the site moves from a subfolder to the root, or the other way round, Pro’s alias block contains the old path. Paste the block generated by the “File addresses” tab again, then run “Verify and activate”.
  • Login address: the secret address does not change. After the switch, open it in a private window, check that wp-login.php still returns 404 and purge the new host’s cache, which may have kept an old response.
  • Pro licence: it is tied to the site’s address. With the same address, simply check its status in the plugin after the switch. With a new domain, move the licence to the new address from your member area; details are on the pricing page.

The host and cache compatibility page details the settings per server and per cache. WP Feint neither migrates nor backs up the site: use one of the methods above for that.

Frequently asked questions

How long does a WordPress site migration take?

The copy takes from a few minutes to a few hours depending on size. Mostly plan for the preparation (TTL lowered 24 to 48 hours before) and a week of checks before cancelling the old hosting.

Will the site go down during the migration?

No, if the new server is ready and tested before the DNS switch: visitors move from the old server to the new one without interruption. Only a site that takes orders needs to freeze content during the final sync.

Should I transfer the domain name at the same time?

No. The domain can stay with its registrar: you only change its DNS records. Transferring the domain at the same time adds a source of error; do it later if you wish.

Does a migration hurt SEO?

Not if the addresses stay the same. With a new domain, page-by-page 301 redirects and Search Console’s Change of Address tool limit the loss, which remains temporary when everything is in place.

What happens to my domain’s email?

If it was hosted by the old host, recreate the mailboxes at the new one, copy the messages, then change the MX records. Hosts’ migration services do not always include email.

Key takeaways

  • Lower the TTL 24 to 48 hours before, test the new server through the hosts file, switch DNS last.
  • List what is not inside WordPress: full DNS zone, email, cron jobs, server rules, certificate.
  • The host’s migration service is often free: it is the first choice.
  • Same address: nothing to declare to Google. New domain: page-by-page 301s and the Change of Address tool.
  • Keep the old hosting for a week; moving to Nginx means carrying WP Feint’s rules into the server configuration.

New server, same protections

WP Feint works on Apache, LiteSpeed and Nginx: the free version moves the login, blocks XML-RPC and hides WordPress; Pro adds two-factor authentication, login limiting and alerts about vulnerable plugins.

See Pro pricing

Sources

  • WordPress Developer: moving WordPress (external link, opens in a new tab)
  • Google Search Console: Change of Address tool (external link, opens in a new tab)
  • Hostinger: migrate a website (external link, opens in a new tab)
  • Kinsta: WordPress migrations (external link, opens in a new tab)
WordPress guides10 min

How to duplicate a WordPress site: tools, manual method and pitfalls

Copying a WordPress site to another address: the tools compared (Duplicator, All-in-One WP Migration, WPvivid, Migrate Guru, WP Staging, UpdraftPlus), the WP-CLI method, the serialized data…