How to move WordPress to a new host
By Ash, Founder, HosteazePublished 3 min read
The short answer
To move WordPress to a new host, back up your site, copy the files and database to the new server, and update wp-config.php with the new database details. Test the site on the new server using your computer's hosts file, then point your domain's DNS at the new host. Keep the old hosting live until DNS has fully switched.

Moving a WordPress site sounds risky, but if your domain name is staying the same it's mostly copying. WordPress's own handbook says that when the database and URLs don't change, you can move a site "by just copying your files and database". The real skill is in the order: copy, test, then switch, so visitors never see a broken site.
Which migration method should I use?
| Method | Best for | Skill needed | Watch out for |
|---|---|---|---|
| Migration plugin (for example Duplicator or All-in-One WP Migration) | Most small sites | Low | Large sites can hit your host's upload size limit on free versions |
| Manual: SFTP plus database export | Large sites, or when plugins fail | Medium | Getting wp-config.php details right |
| New host migrates it for you | Anyone who'd rather not | None | Check what's included before you sign up |
Many hosts include migration. If you're moving to us, migration is free. Whichever you choose, the checks below still apply.
How do I move WordPress manually?
- Back up your files and database on the old host, and download a copy to your computer. Our guide on how to back up a WordPress site covers this.
- A day before, lower the TTL on your domain's A record to 300 seconds (five minutes), so the switch spreads quickly.
- On the new host, create an empty database and a database user, and note the database name, username, password and host.
- Upload all your WordPress files to the new server's web folder by SFTP.
- Import your database file using the new host's database tool, often phpMyAdmin.
- Edit
wp-config.phpon the new server. ChangeDB_NAME,DB_USER,DB_PASSWORDandDB_HOSTto the new details. - Test the new copy (see below).
- Update your domain's DNS to point at the new server. How to point a domain to a website shows where to change it.
How do I test the new site before switching DNS?
Use your computer's hosts file. It tells your computer alone to visit the new server when you type your domain, while everyone else still sees the old one.
- Get the new server's IP address from your new host.
- Open the hosts file as an administrator. On Windows it's
C:\Windows\System32\drivers\etc\hosts; on a Mac it's/etc/hosts. - Add a line such as
203.0.113.10 yourbusiness.co.uk www.yourbusiness.co.uk, using the real IP. - Save, then visit your site. Click through key pages, submit the contact form and log in to the dashboard.
- Remove the line when you're done, or you'll be confused for weeks about which server you're looking at.
What if my domain name is changing too?
Then the database is full of your old address, and a plain find-and-replace can break things. WordPress warns that some themes and widgets store data with the length of the URL recorded, so changing it by hand corrupts those settings. Use a tool that handles this, such as the Better Search Replace plugin or WP-CLI:
wp search-replace 'https://old-domain.co.uk' 'https://new-domain.co.uk' --skip-columns=guidSkip the guid column. WordPress uses it to identify posts in feeds and says it should never change.
When can I cancel my old hosting?
Not straight away. DNS changes can take up to 48 hours to reach everyone, as explained in how long DNS propagation takes. Keep the old account for at least a week, and check that new orders, comments and form entries are arriving on the new server before you close it. If your email lives with the old host, move that first.
Step by step
1.Back up everything
Take a full backup of your WordPress files and database and save a copy on your own computer.
2.Lower your DNS TTL
A day before the move, lower the TTL on your domain's A record to 300 seconds so the switch spreads faster.
3.Copy the site to the new host
Use a migration plugin, or upload the files by SFTP and import the database through the new host's control panel.
4.Update wp-config.php
Change DB_NAME, DB_USER, DB_PASSWORD and DB_HOST to the new database details.
5.Test using your hosts file
Point your domain at the new server's IP address in your computer's hosts file and check the site works.
6.Switch DNS
Update your domain's A record or nameservers to the new host, then keep the old hosting for at least a week.
Frequently asked questions
Will moving hosts affect my Google rankings?
Not if your domain and URLs stay the same and the site doesn't go down. Google sees the same pages at the same addresses. Rankings can wobble if the move causes downtime, broken pages or a much slower site, so test before switching DNS.
What happens to my email when I move WordPress?
It depends where your email is hosted. If it's with Google Workspace or Microsoft 365, leave your MX records alone and it carries on working. If your email is with your old web host, plan its move separately before you cancel that account.
Should I move my domain at the same time?
No. Move the website first and keep the domain where it is. Transferring the domain is a separate job you can do later, and doing both at once makes problems harder to trace.




