Moving a WordPress site to a new host does not have to take your website offline. The safe approach is to build and test the new copy first, and only switch your domain once everything works. This guide explains the three ways to migrate, the exact steps in the order that avoids downtime, and how to protect your search rankings.
What is a WordPress migration?
A migration means moving your site’s files, database and settings from one place to another: a new host, a new server, or a new domain. The site itself stays the same, but where it lives changes.
Three ways to migrate a WordPress site
1. Manual migration
You copy the files over SFTP, export and import the database, and update the configuration yourself. It gives you full control and works for any site, but it needs technical comfort and care.
2. Migration plugin or host tool
Plugins and tools provided by hosting companies package your files and database and unpack them on the new host. This is faster and suits small to medium sites, but large databases, special server settings and multisite networks can cause trouble.
3. Managed migration service
A professional handles the move, tests it and fixes problems. This is the safest choice for a store, a membership site or any site that cannot afford surprises.
Before you start: checklist
- Take a full backup of files and database, and confirm it can be restored.
- Write down your setup: PHP version, active plugins and themes, and every DNS record, including the MX records that keep email working.
- Lower your DNS TTL a day or two before the move so changes spread faster when you switch.
- Choose the new host and match the PHP and database versions of your current site where possible.
- Pick a quiet time to switch, especially if you take orders.
Step by step: the manual method
Step 1: Prepare the new host
Create the hosting account and a new empty database with its own user. Set up SSL on the new host so HTTPS works from the first visit.
Step 2: Download your site files
Connect over SFTP and download everything in your site folder, including wp-content, which holds your themes, plugins and uploads.
Step 3: Export your database
Export the database from your old host, usually with phpMyAdmin, as a single file.
Step 4: Import the database on the new host
Import that file into the new empty database.
Step 5: Upload the files and update the configuration
Upload the files to the new host, then edit wp-config.php with the new database name, user and password. If the web address is changing, update it everywhere in the database with a safe search and replace tool, not by editing the text file by hand.
Step by step: the plugin method
Install a migration plugin on the old site, build a package of files and database, download it, and run the plugin’s installer on the new host. Follow the plugin’s own instructions, because the details differ between tools. Check the result carefully afterwards: images, menus, forms and permalinks.
Using WP-CLI for a faster migration
If your host gives you command-line access, WP-CLI can export and import the database and fix the web address in one go. Run these on a backed-up copy first:
wp db export site-backup.sql
wp db import site-backup.sql
wp search-replace 'https://oldsite.example' 'https://newsite.example' --dry-runThe dry run shows what would change without changing it. Run the command again without the flag only when the result looks right. The search and replace step matters because WordPress stores web addresses in several places, including serialized data, and WP-CLI handles that safely.
How to preview the new server before DNS changes
The hosts file on your computer lets you point your domain to the new server for yourself only, while everyone else still reaches the old one:
- Get the new server’s IP address from your new host.
- Open the hosts file on your computer. On Mac and Linux it is /etc/hosts. On Windows it is the hosts file inside the drivers/etc folder of your system directory.
- Add a line with the new IP address, a space and your domain name, then save it.
- Open your site in a fresh browser window and test it. Remove the line when you have finished.
Test before you switch DNS
Open the copy using a temporary URL or by editing your computer’s hosts file so your browser sees the new server while everyone else still sees the old one. Check the home page, inner pages, forms, login, search and, for a shop, the whole checkout. Ask search engines not to index the copy while you test.
Understanding your DNS records
DNS is the address book of your domain. Changing the wrong record is the most common way to break email during a move.
- A record: points your domain to a server’s IP address. This is usually what changes when you move host.
- CNAME record: points one name to another, for example www to your main domain.
- MX records: tell the world where your email lives. If email is hosted elsewhere, leave these alone.
- TXT records: hold things like email authentication (SPF, DKIM) and domain verification. Copy them across if you move your DNS.
If you only change hosting, you normally change only the A record, or the nameservers if your new host manages your DNS. Take a screenshot or export of every existing record before you touch anything.
Cut over: switch DNS
- If the site changes often (orders, comments, new posts), pause changes and copy the latest data across.
- Update your domain’s DNS records to point to the new host.
- Expect a short overlap. For a while some visitors may reach the old server and some the new one. That is normal, and it is why the old host must stay active.
After the move
- Re-save permalinks and test a few inner pages.
- Send a test message through every contact form.
- Confirm email still arrives.
- Check HTTPS on every page with no warnings.
- Turn search engine visibility back on if you blocked it while testing.
- Check Google Search Console for new crawl errors in the following days.
- Run a speed test, because a new host can change load times.
- Keep the old host for a few days until you are sure, then cancel.
Moving a WooCommerce store
A store needs extra care because orders keep arriving while you move. Plan it around a quiet period and think through these points:
- Orders during the move: any order placed on the old site after you copied the database will not be on the new one. Pause orders briefly, or copy the latest orders across at cut-over.
- Payment gateways: check that webhooks, API keys and the SSL certificate work on the new host, and place a test order.
- Scheduled tasks: confirm emails, stock updates and subscription renewals still run.
- Caches and CDN: clear them after the switch so customers see the new site.
Protecting your search rankings
If the web address of your pages stays the same, rankings normally hold. Problems appear when URLs change, the site is left blocking search engines, or pages return errors. If any URLs change, set up permanent (301) redirects from old to new, keep the same page titles and content, and watch Search Console closely for a few weeks.
Troubleshooting after a migration
- Error establishing a database connection: recheck the database name, user, password and host in wp-config.php.
- Blank white screen: turn on debugging temporarily or ask the host for the PHP error log. A plugin or PHP version difference is a common cause.
- Broken images or mixed content warnings: old web addresses are still stored in the database. Run a safe search and replace.
- Inner pages show 404 errors: go to Settings, then Permalinks, and save without changes to refresh the rules.
- Redirect loops: check the site address settings and any SSL or redirect plugin, and clear caches.
Common mistakes
- Cancelling the old host too early.
- Forgetting the email DNS records.
- Leaving the new site set to block search engines.
- Skipping the checkout or form tests.
- Not keeping a backup of the old site.
When to use a managed migration service
Hire help if the site takes payments, is large, uses a multisite network, has custom server settings, or if downtime would cost you money. See our WordPress migration services.
Frequently asked questions
Will my site go down during migration?
It should not, if you build and test the new copy first and only switch DNS when it works. A brief overlap while DNS updates is normal, and no guide can promise literally zero risk.
How long does DNS take to update?
It depends on your TTL and your DNS provider. It can be quick, and sometimes it takes up to a day or two to reach everyone, which is why you keep the old host running.
Will I lose my SEO?
Not if the URLs stay the same, the site is not blocked from search engines, and nothing returns errors. If URLs change, use 301 redirects.
Can I move to a new domain at the same time?
It is safer to move host first, confirm everything works, and then change the domain as a separate step.
Do I have to move my domain registration to the new host?
No. The domain registration and the hosting are separate. You only change where the domain points.
Should I update plugins during the move?
It is safer to move first, confirm everything works, and update afterwards. Changing too many things at once makes problems harder to trace.
What if the new host is slower?
Compare speed on the new server before you switch DNS. Differences in PHP version, caching and server resources can change load time, so test and adjust before you go live.
Keep it healthy afterwards
Once the move is done, regular care keeps the new setup safe: read about WordPress maintenance and support, or learn how to clone a WordPress site for testing.
Want us to handle it? Send us a message through the contact form and we will review your site and reply with the plan.
