WordPress & Web 10 mins read

How to Migrate WordPress to a New Host: A Safe, Step-by-Step Guide

D
Dripex Editorial Team Dripex Team
Published: • Updated:
How to Migrate WordPress to a New Host - Dripex guide

Moving a site is one of those jobs that feels risky until you have done it once. The good news is that the process is the same every time, and most of the risk comes from skipping the basics. This guide shows you how to migrate WordPress to a new host, or to a new domain, with a backup at the start, a test before the switch and a checklist at the end.

Best forSite owners changing host or domain
LevelIntermediate
Time neededOne to three hours for a typical site
Last reviewedOctober 2026
Key takeaways

The short version

  • Back up before you do anything. Files and database, with a copy somewhere off the server.
  • Copy, then test, then switch. Get the new site working on the new host before you change DNS.
  • Moving host is easy. Changing domain needs extra steps. URLs inside the database must be updated, and old addresses redirected.
  • Do not forget email. If your email uses the same domain, check your DNS records before you switch.

Moving host or moving domain: know which one you are doing

Two different jobs share the word “migration”, and they need different amounts of work. Decide which one you are doing before you start.

Host change versus domain change
AspectNew host, same domainNew domain
What movesFiles and databaseFiles, database and every address inside them
URLs in the databaseUsually stay the sameMust be updated
Redirects neededNone301 redirects from the old domain to the new one
SEO riskLow if the switch is cleanHigher, so plan it carefully
Switch stepPoint DNS to the new hostUpdate addresses, then redirect the old domain

The steps below cover both. Where a step only applies to a domain change, it says so. For background reading, the official guide to moving WordPress covers the same ground in more depth.

Before you begin: preparation

A calm migration depends on what you do before it starts.

  • Choose and set up the new host first. Make sure the new plan has enough space and a PHP and database version that your site supports.
  • Take a full backup of the files and the database and download a copy. Our WordPress backup guide links to the official instructions.
  • Pause changes to the old site. New orders, comments or posts made during the move can be lost. Choose a quiet time and tell your team.
  • Lower your DNS time-to-live (TTL) a day or two before the switch, if your DNS provider lets you. A lower TTL means the new address spreads sooner.
  • Write down your DNS records, especially mail records, before you change anything.
Keep the old site running until the end

Do not cancel the old hosting until you have checked the new site thoroughly and DNS has settled. If something goes wrong, the old site is your way back.

Three ways to move the site

There is more than one way to migrate WordPress to a new host. The method decides how much of the work you do yourself, so choose it before you start.

Choosing how to move
MethodHow it worksBest when
Your new host moves itThe host copies your site, often for free on some plansYou want the least work and the host has a clear process
A migration pluginThe plugin packs the site and unpacks it on the new hostThe site is small or medium and you want a guided route
By handYou copy the files and database yourself and edit the settingsThe site is large, unusual or you want full control

Whichever you choose, keep your own backup. The manual route below is the one every other method is built on, so it is worth understanding even if you let someone else do the work.

Step by step: how to migrate WordPress to a new host

  1. Export the database. Use phpMyAdmin, or run wp db export over the command line. Keep the .sql file safe.
  2. Download the files. Copy the whole WordPress folder, including wp-content (your themes, plugins and uploads) and wp-config.php.
  3. Create a new database and user on the new host. Note the database name, user, password and host name.
  4. Import the database into the new database, using phpMyAdmin or the command line.
  5. Upload the files to the new host, into the folder that will serve your site.
  6. Edit wp-config.php so it uses the new database name, user, password and host.
  7. Check the file permissions. The WordPress guide notes that files showing 0000 permissions should be changed to 0644.
  8. Test the site before changing DNS (see the next section).
  9. Switch DNS so your domain points to the new host.
  10. Run the final checks at the end of this guide.

If you are changing the domain as well

Two extra jobs apply. First, update the site address: in Settings, General, set the WordPress Address and the Site Address to the new domain, including https:// and with no trailing slash. Second, replace the old address inside your content with a tool that understands serialised data, not a plain text find-and-replace.

The WordPress guide warns that a careless replace can break serialised data when the length of the address changes, and that you should never change the guid column. WP-CLI’s search-replace command handles both, and --dry-run shows you what would change first.

Test the new site before you switch DNS

This is the step that separates a smooth migration from a stressful one. You can view the new site on its new server while the public still sees the old one.

  1. Find the new server’s IP address in your new host’s control panel or welcome email.
  2. Edit the hosts file on your own computer so your domain points to that IP. This affects only your computer.
  3. Open your site in a private window. You are now seeing the new host, even though the world still sees the old one.
  4. Click through the important pages. Log in to the dashboard, open a post, submit the contact form and, for a shop, place a test order.
  5. Remove the hosts file entry when you have finished testing.

If your host offers a temporary address for the new site, you can use that instead of the hosts file.

Switching DNS without losing email

DNS is the phone book that tells browsers where your site lives. Changing it points visitors at the new host. It can also break email if you are not careful, because the same DNS records control where mail goes.

DNS records to check before you switch
RecordWhat it controlsWhat to do
A record (and AAAA)Where your domain pointsChange it to the new host’s IP address
CNAMEAliases such as wwwMake sure www points to the right place
MXWhere your email is deliveredDo not change it unless you are also moving email
TXT (SPF, DKIM, DMARC)Email authentication and verificationKeep them as they are, unless your mail provider tells you to change them
NameserversWhich provider controls all of the aboveIf you change them, copy every record to the new provider first
Two ways to switch

You can either change the A record at your current DNS provider, or move the nameservers to the new host. Changing only the A record is the safer choice if you use email on the domain, because the other records stay exactly where they are.

DNS changes can take a few hours to spread, and sometimes longer. That is why the old site stays up. When visitors reach the new host, you will see traffic move over.

If your site is a shop or takes bookings

Orders and bookings made on the old site while you move are the easiest thing to lose. Pick a quiet time, put the shop in maintenance mode or pause checkout while you copy the database, and check afterwards that no order was placed in the gap. After the switch, place a test order and confirm that the emails and the payment gateway work on the new host.

Pretty URLs depend on rewrite rules. After the move, go to Settings, Permalinks and save without changing anything, which rebuilds the rules. If you had custom redirects or other rules in your old .htaccess, copy them across and check that they point to the right addresses.

If you changed the domain, add permanent (301) redirects from every old address to its new equivalent, so that visitors, links and search engines land on the right page. Google’s guide to moving a site with URL changes explains what to do in Search Console as well.

The final checklist

After the switch, spend half an hour checking the site as a visitor would.

  • The home page and a few inner pages load over https, with no browser warnings.
  • Images, fonts and downloads appear. Missing images usually mean old addresses.
  • Forms send email and you receive it. Test every form.
  • Login and password reset work.
  • Shop and payments work. Place a test order and check the emails.
  • The sitemap and robots.txt are right and search engines are allowed in.
  • Search Console and analytics still collect data. If the domain changed, use the change-of-address tool and update your property.
  • Scheduled tasks run. Check backups, scheduled posts and any cron jobs.
  • A fresh backup of the new site exists.

Common problems and quick fixes

If something breaks after the move
What you seeLikely causeWhat to try
“Error establishing a database connection”Wrong details in wp-config.phpCheck the database name, user, password and host
The site redirects to the old addressThe old URL is still set in the options or in the contentCheck siteurl and home, then run a search and replace
Images are brokenOld addresses, or the uploads folder is missingReplace the old URLs and check the uploads folder
Pages return 404 errorsRewrite rules missingSave the permalinks again and check .htaccess
Mixed content warningsSome links still use httpReplace http addresses with https
Email stopped workingMX records changed by mistakeRestore the original MX and TXT records

A plugin can do much of this work for you, and so can your new host. If you would rather make a copy first, read our guide on how to clone a WordPress site, which uses the same steps. And if you are starting from scratch, how to create a website covers the setup.

Frequently asked questions

Will migrating hurt my search rankings?

A clean move to a new host with the same domain and the same addresses should not. A change of domain carries more risk, so redirect every old page to its new address and tell Search Console. Nobody can promise that rankings will not move.

How long does a WordPress migration take?

For a typical small site, an hour or two of hands-on work. DNS can take longer to spread, so keep the old site running until you are sure.

Will my site go down during the move?

It does not need to. The site stays live on the old host while you build the copy, and visitors move across when DNS changes.

Can my new host move the site for me?

Many hosts offer a migration service or a plugin. Ask what is included, whether it covers email, and still keep your own backup.

Should I use a plugin or move it by hand?

Plugins are quicker for small and medium sites. A manual move gives you more control, which helps with large or unusual sites. Both follow the same steps.

What if something goes wrong?

Switch DNS back to the old host, which should still be running. Then use your backup and the troubleshooting table to find the cause before trying again.

Keep reading

Share this guide:
D

Written by Dripex Editorial Team

The Dripex team writes plain-language guides on social media growth, SEO and running a WordPress site. Every guide says what we know, what we do not, and links to the rules of the platform it is about.

← Explore all guides
← Previous Article How to Host Videos on WordPress: Self-Host, YouTube or a Video Platform? Next Article → How to Clone a WordPress Site: 3 Methods, Step by Step
GROW FASTER WITH DRIPEX

Looking for comments, likes or views?

Pick a package, paste the link to your post or profile, and follow the order from your account. No password is ever needed.