How to Migrate WordPress to a New Host

Switching hosting providers is one of the most common tasks in WordPress site management. Your current host might be slow, unreliable, or simply too expensive for what it offers. Whatever the reason, migrating a WordPress site to a new host is completely doable — even without technical experience — if you follow a clear, ordered process.

The main risk in any migration is data loss or extended downtime. Neither has to happen. With a proper backup and a methodical approach, you can move a WordPress site to a new host in a few hours and most visitors will never notice the switch.

This guide walks through the full process using both a plugin and a manual method, so you can choose whichever suits your site and confidence level. For a broader look at building and managing a site from scratch, see the step-by-step guide to building a WordPress website.

Quick Answer

To migrate WordPress to a new host: back up your existing site (files and database), set up WordPress on the new host, transfer your files and database, update wp-config.php with the new database credentials, test the site before touching DNS, then point your domain to the new server once everything checks out. A migration plugin can handle most of this automatically; a manual approach gives you more control for larger or more complex sites.

Why This Matters

Your hosting environment directly affects your site’s speed, uptime, and security. A poor host is one of the most common causes of slow WordPress sites — ones that pass code and image audits perfectly but still deliver a frustrating experience. Moving to a better host can improve your Core Web Vitals scores, reduce server response time, and cut downtime without touching a line of code.

Migrations also come up when you outgrow your current plan, consolidate multiple sites under one account, or move a site from a client handover to your own infrastructure. The underlying process is the same regardless of the reason.

Step-by-Step: How to Migrate WordPress to a New Host

Step 1 — Back up your entire site

Before moving anything, create a full backup of your current site — both the WordPress files and the database. If you don’t already have a regular backup schedule in place, set one up before starting. A backup is your safety net if anything goes wrong during the transfer.

For the database: log into cPanel on your current host, open phpMyAdmin, select your WordPress database from the left panel, click Export, and save the .sql file to your computer. For files: connect via FTP (FileZilla works well) and download everything in your WordPress root directory — including wp-admin, wp-includes, wp-content, and all files in the root itself, including wp-config.php.

Step 2 — Set up your new hosting account

Sign up for your new hosting account and log into cPanel. If you haven’t decided on a provider yet, it’s worth comparing your options — shared, VPS, and managed WordPress hosting differ significantly in performance, control, and cost, and choosing the wrong tier is an easy mistake to make at this stage.

Create a new MySQL database in cPanel’s MySQL Databases section. Create a database user, assign full privileges, and note down the database name, username, and password — you’ll need all three when updating wp-config.php.

Step 3 — Transfer your WordPress files

Upload all your WordPress files to the new host via FTP. Connect to the new server using FTP credentials from your new hosting dashboard, navigate to public_html (or the directory your domain points to), and upload everything you downloaded in Step 1.

If you are using the All-in-One WP Migration and Backup plugin, the process is considerably simpler: install the plugin on your existing site, run an export to create a .wpress file, install WordPress fresh on the new host, install the same plugin, and import the .wpress file. It handles files and the database in a single step.

Step 4 — Import the database and update wp-config.php

Open phpMyAdmin on your new host, select the database you created in Step 2, click Import, and upload the .sql file exported from the old host. Once the import finishes, open wp-config.php in a text editor and update the database connection details to match your new database:

define( 'DB_NAME', 'new_database_name' );
define( 'DB_USER', 'new_database_user' );
define( 'DB_PASSWORD', 'new_database_password' );
define( 'DB_HOST', 'localhost' );

Save the file and upload it back to the new server via FTP, replacing the version already there.

Step 5 — Test the site before changing DNS

Before pointing your domain to the new host, test the migrated site using your local hosts file. On Windows, open C:WindowsSystem32driversetchosts as administrator and add a line mapping your domain to the new server’s IP address. On Mac or Linux, edit /etc/hosts the same way.

With that in place, your browser loads the site from the new host while the rest of the world still sees the old one. Check all pages, test your contact form, confirm media loads correctly, and verify the admin area works. Fix any issues before proceeding to the DNS step.

Step 6 — Update DNS and activate SSL

Once the site is verified on the new host, update your domain’s DNS nameservers to point to the new hosting provider. This change typically propagates within a few hours, but allow up to 48 hours for full global propagation.

After DNS propagates, verify that your SSL certificate is active on the new host. Most hosts provide Let’s Encrypt via cPanel at no cost. If you run into mixed content warnings or redirect issues after the switch, the guide on setting up SSL and HTTPS in WordPress covers the common fixes in detail.

Practical Tips

Keep your old hosting account active for at least 48–72 hours after the DNS switch. If something breaks after the cutover, you can revert DNS quickly and still have a working site while you troubleshoot.

If the old site had hardcoded URLs in the database — pointing to an old domain or a staging address — run a database search-and-replace after migration. The Better Search Replace plugin handles this safely without breaking serialised data.

In my experience, wp-config.php credentials are the most common failure point in a migration. The database name, username, and password all need to match exactly what you created on the new host. Get those right before you test anything else.

Common Mistakes

  • Cancelling old hosting immediately — DNS propagation takes time, and if something breaks you’ll want the old site still available. Keep the old account active for a few days.
  • Changing DNS before testing — if the migrated site has a broken database connection or missing images, fix it before going live or you’ll push a broken site to all visitors.
  • Forgetting to update wp-config.php — the file on the new server still has the old database credentials. Always update it manually after uploading.
  • Skipping the hosts file test — this five-minute step can save hours of cleanup after a bad cutover.

Plugin vs Manual Migration

For most sites under 512MB, a plugin like All-in-One WP Migration handles the transfer far more quickly than a manual approach. The free version covers the majority of small to medium WordPress sites; the paid extension removes the file size limit for larger ones.

Manual migration via FTP and phpMyAdmin is worth the extra effort for larger sites, sites with custom server configurations, or when you want precise control over what gets copied. It also gives you a clearer understanding of your site’s structure — useful for diagnosing issues that surface post-migration.

Conclusion

Back up first, test on the new host before touching DNS, and keep your old account active until you’re satisfied everything is working. Follow that sequence and the majority of migration problems disappear before they start.