Performance & Hosting

Step-By-Step WordPress Migration Between Hosts

A manual, plugin-free guide to safely moving your WordPress site to a new host

Moving a live WordPress site from one hosting provider to another can feel risky. You worry about downtime, broken pages, and the nightmare of losing data if something goes wrong.

In this step-by-step guide, you’ll learn how to perform a manual, plugin-free WordPress migration between hosts. You’ll copy your files and database, configure the new server, test everything safely, and then switch DNS with minimal downtime.

If you’re completely new to hosting, it can help to quickly review how WordPress hosting works so the steps in this migration guide make more sense.

Prerequisites

Before you start moving anything, make sure you have everything you need for a clean, low-stress migration.

  • Login access to your old host (cPanel, Plesk, or custom panel).
  • Login access to your new host (control panel + FTP/SFTP and/or SSH).
  • Access to your domain registrar to update DNS or nameservers.
  • Your current site must be working correctly (fix any obvious errors first).
  • Enough disk space on the new host to hold all site files and backups.
Warning: Never start a migration without a verified backup. If something fails mid-way, your backup is the only way to restore your site.

If you’re not confident about your backup process, follow this dedicated tutorial on how to backup a WordPress site before you continue.

Step 1: Plan Your WordPress Migration Between Hosts

A little planning dramatically reduces downtime and surprises when you move between hosting providers.

  1. Pick a low-traffic window. Schedule your migration for late night or early morning in your main audience’s time zone.
  2. Check PHP and MySQL versions. Confirm your new host supports at least the same or newer versions than your old host.
  3. Disable non-essential changes. Let your authors or team know there is a content freeze during the migration so no new posts or orders are added mid-move.
  4. Lower DNS TTL (optional but recommended). If your DNS TTL is high (e.g., 4 hours), lower it to 300–900 seconds the day before migration to speed up DNS propagation.
Note: If your new host offers a staging environment, you can migrate to staging first, test, and then push to production for an even safer cutover.

Step 2: Backup Your WordPress Site Safely

Even though this guide walks you through a controlled process, mistakes can happen. A full backup lets you roll back to your original host if needed.

2.1 Backup your files

  1. Log in to your old host’s control panel and open File Manager (or connect via FTP/SFTP).
  2. Locate the folder that contains WordPress (commonly public_html or a subdirectory).
  3. Select all WordPress files and folders (wp-admin, wp-content, wp-includes, and root files like wp-config.php).
  4. Use the “Compress” or “Archive” option to create a single .zip file of your site.

2.2 Backup your database

  1. From the control panel, open phpMyAdmin.
  2. In the left sidebar, click your WordPress database (the name is referenced in wp-config.php).
  3. Click the Export tab, select Quick export and SQL format, then click Go to download the .sql file.
Warning: Store your backups in at least two places (local computer + cloud storage) before you start changing anything on your original host.

Step 3: Prepare the New Hosting Environment

Your new host needs a ready environment for WordPress before you copy anything over.

  1. Create a new database. In the new host’s control panel, open MySQL Databases (or similar) and create a new database.
  2. Create a database user. Create a new user and assign a strong password.
  3. Assign user to database. Give the user All Privileges on the new database.
  4. Note the credentials. Write down:
    • Database name
    • Database username
    • Database password
    • Database host (often localhost, but some hosts use a different hostname)
Pro Tip: Use a password manager to store your database credentials securely. You’ll need them when you update wp-config.php later.

Step 4: Move WordPress Files to the New Host

Now you’ll copy the WordPress files you backed up from the old host into the document root on the new host.

4.1 Upload the backup archive

  1. Log in to your new host’s control panel and open File Manager.
  2. Navigate to the folder where the site should live (often public_html or a subfolder for add-on domains).
  3. Upload the .zip file you created on the old host.

4.2 Extract the backup

  1. Once the upload finishes, select the .zip file.
  2. Use the Extract option to unpack the WordPress files into the current directory.
  3. Verify that directories like wp-content and files like wp-config.php are present.
Note: After confirming that everything works on the new host, you can safely delete the uploaded .zip archive to save disk space.

Step 5: Export the Database from the Old Host (If Not Done Yet)

If you already exported your database in Step 2, you can skip directly to the next step. Otherwise, export it now.

  1. Open phpMyAdmin on your old host.
  2. Select the correct WordPress database in the left sidebar.
  3. Click Export, choose the Quick method and SQL format, and click Go.

Step 6: Import the Database on the New Host

Next, you’ll import your WordPress database backup into the new database you created on the new host.

  1. On the new host, open phpMyAdmin and select the new database you created in Step 3.
  2. Click the Import tab.
  3. Click Choose File and select the .sql file you exported from the old host.
  4. Leave the format as SQL and click Go to import.
  5. Wait for the success message confirming all tables have been imported.
Warning: If the import fails due to file size limits, ask your host to temporarily raise the limit or import the SQL file via SSH using the mysql command.

Step 7: Update wp-config.php with New Database Details

Your WordPress files still reference the old database. You need to point them to the new database on the new host.

  1. In the new host’s File Manager (or via FTP/SFTP), open the WordPress root folder.
  2. Locate wp-config.php and open it in the code editor.
  3. Find the following lines:
define( 'DB_NAME', 'old_db_name' );
define( 'DB_USER', 'old_db_user' );
define( 'DB_PASSWORD', 'old_db_password' );
define( 'DB_HOST', 'localhost' );
  1. Replace the values with your new database name, user, password, and host from Step 3.
  2. Save the file.
Note: Be careful not to change anything else in wp-config.php. A small typo can trigger connection errors or PHP warnings.

Step 8: Update URLs and Paths After Migration

If your domain is staying exactly the same, you often don’t need a full search-and-replace. However, it’s still smart to check for any references to the old host’s temporary URLs or old paths.

8.1 Update site URL (if needed)

If you’re testing via a temporary URL or changing the domain, you may need to update the site URL and home URL in the database.

  1. In phpMyAdmin on the new host, open the wp_options table.
  2. Update the siteurl and home values to the correct final URL (e.g., https://yourdomain.com).

8.2 Optional: Use WP-CLI for bulk URL changes

If you have SSH access and WP-CLI installed, you can safely update URLs from the command line.

wp search-replace 'old-domain.com' 'new-domain.com' --skip-columns=guid

Run this command in your WordPress installation directory on the new host. It will replace all instances of the old domain in the database while skipping the post GUID field.

Pro Tip: Always dry run search-and-replace commands on a staging copy first to ensure you’re not unintentionally changing data you care about.

Step 9: Test the Site on the New Host

Before you flip DNS, you should fully test the migrated site on the new hosting environment.

9.1 Preview using a temporary URL or hosts file

  1. Many hosts provide a temporary URL (e.g., https://ipaddress/~username) to preview your site.
  2. If not, edit your local hosts file to point your domain to the new server’s IP address. For example:
203.0.113.10   yourdomain.com   www.yourdomain.com

Replace 203.0.113.10 with your new host’s IP. Only your computer will use this mapping, so visitors still see the old host until you update DNS.

9.2 Run through a wordpress migration checklist

  • Test homepage, key landing pages, and blog posts.
  • Log in to wp-admin and verify you can access the dashboard.
  • Check permalinks (Settings > Permalinks) and re-save them if you see 404 errors.
  • Submit forms, test search, and complete test orders if you run WooCommerce.
  • Confirm media files (images, downloads) load correctly.
Warning: If you see database connection errors, blank pages, or redirects back to the old host, re-check your wp-config.php values and your site URL settings in the database.

Step 10: Switch DNS and Monitor After Go-Live

Once you’re happy with how the site behaves on the new host, you’re ready to point the domain to the new server.

10.1 Update nameservers or A records

  1. Log in to your domain registrar.
  2. If your new host manages DNS, change your domain’s nameservers to the new host’s nameservers.
  3. Otherwise, update the DNS A record for yourdomain.com (and www if used) to point to the new host’s IP address.

10.2 Monitor propagation and performance

  • DNS changes can take a few minutes up to 24–48 hours to fully propagate, depending on TTL and caches.
  • Keep both old and new hosting accounts active for at least a couple of days to be safe.
  • Monitor error logs on the new host for any PHP errors or 500 responses.
  • Ask a few users in different locations to confirm they see the site on the new host.

For deeper troubleshooting of edge cases during or after the move, you can refer to this dedicated guide on troubleshooting WordPress migration errors.

Wrapping Up Your WordPress Host-to-Host Migration

You’ve now completed a full manual WordPress migration between two hosting providers: backing up files and database, preparing the new environment, copying everything over, updating configuration, testing thoroughly, and switching DNS with minimal downtime.

Once you’re confident the new host is stable and all traffic has switched over, you can cancel your old hosting account. Keep your backups for a while longer and document your process so you can repeat it smoothly the next time you move or clone your site.

As a next step, consider optimizing your new hosting setup for speed, security, and regular backups so you’re ready for growth and future changes.

Further Reading

Frequently Asked Questions

Can I migrate my WordPress site between hosts without any downtime?

Yes, you can usually keep downtime close to zero by planning carefully. The key is to copy files and database to the new host first, test the site using a temporary URL or hosts file override, and only then update DNS. Keeping both hosts active during propagation ensures visitors always see at least one working copy of your site.

What should I do if I see a database connection error after migration?

A “Error establishing a database connection” message usually means your wp-config.php settings don’t match the new database. Check that DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST match exactly what you created on the new host. Also verify that the database user has full privileges on the database and re-test.

Is it safer to use a migration plugin instead of a manual process?

Migration plugins can simplify parts of the process, especially for small to medium sites, but they are not magic. A manual approach gives you more control and a deeper understanding of how your site is structured. For mission-critical sites, many professionals combine both: a migration plugin plus manual verification of files, database, and configuration.

How can I keep my site secure while moving between hosts?

Use strong, unique passwords for your hosting, FTP/SFTP, and database accounts, and never email plain-text credentials. Delete old backup archives from the server once you’ve confirmed a successful migration. After the move, review your security plugins, SSL configuration, and file permissions to ensure the new environment matches or improves on your previous security baseline.

How long does a typical WordPress host-to-host migration take?

For a small to medium site (up to a few gigabytes), the actual migration work often takes 1–3 hours, depending on backup and upload speeds. DNS propagation can add several hours before all visitors reach the new host. Larger or more complex sites (e.g., big WooCommerce stores) will take longer due to database size and the extra testing required.

Andreas Weiss

Andreas Weiss is a 47-year-old WordPress specialist who has been working with WordPress since 2007. He has contributed to projects for companies like Google, Microsoft, PayPal and Automattic, created multiple WordPress plugins and custom solutions, and is recognized as an SEO expert focused on performance, clean code and sustainable organic growth.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button