Hosting Beginner

How to Migrate WordPress to a New Host (Step-by-Step)

JO
James O'Brien
10 min read

Affiliate disclosure: WPSchool earns a commission on some links in this article. We only recommend tools we’ve tested ourselves.

Last verified: April 2026

How to Migrate WordPress to a New Host

Migrating WordPress to a new host is a task most site owners face eventually—whether you’re escaping slow shared hosting, moving a client site to a managed plan, or switching providers to save money. Done correctly, the process takes under two hours and results in zero data loss. Done incorrectly, it corrupts your database or breaks your URLs.

This guide is for: small business owners, freelancers, and beginners managing WordPress sites on shared hosting who want to move to a better host without hiring a developer or paying for a concierge migration.

What You’ll Achieve

Migrating WordPress to a new host means copying your files and database to the new server, updating your configuration to point to the new database, then switching DNS. Using a plugin like Duplicator or All-in-One WP Migration, you can complete the full migration in 60–90 minutes on a site under 1 GB.


Prerequisites

Before you start, confirm all of the following:

  • WordPress admin access (you need the wp-admin login on your current site)
  • New hosting account already purchased and active — we recommend Cloudways for sites with moderate traffic or SiteGround for beginners on a budget
  • FTP/SFTP credentials OR a file manager from your new host’s control panel
  • Full backup taken — this is not optional; if anything breaks mid-migration, you need a restore point
  • ~90 minutes uninterrupted
  • PHP 7.4 or higher on both old and new host (check in your hosting panel under PHP settings)

Duplicator is the migration plugin we use most often across client sites. It packages your entire WordPress install — files and database — into a single installer archive. As of version 1.5, the free tier supports sites up to 500 MB. Larger sites require Duplicator Pro ($69.99/year), which also handles 10 GB+ packages and scheduled backups.

Step 1: Install Duplicator on Your Current Site

  1. Log in to your current WordPress admin.
  2. Go to Plugins > Add New.
  3. Search for Duplicator.
  4. Click Install Now, then Activate.

You should now see Duplicator in your left admin sidebar.

Step 2: Create a Package

  1. Go to Duplicator > Packages.
  2. Click Create New in the top-right corner.
  3. Leave all settings at default unless your site is over 500 MB (in which case, switch to Duplicator Pro before continuing).
  4. Click Next, then wait for the system scan to complete.
  5. Click Build.

The build process takes 30 seconds to 5 minutes depending on your site size. When it finishes, you’ll see two download buttons: Installer and Archive. Download both files to your computer. The archive is your entire site; the installer is the PHP script that unpacks it on the new host.

Step 3: Upload Files to the New Host

  1. Log in to your new host’s file manager (via cPanel, Plesk, or SFTP).
  2. Navigate to the public_html directory (or the folder your domain points to).
  3. Upload both the installer.php and the archive.zip files.

In our testing, upload speeds on SiteGround’s file manager averaged about 8–12 MB/s on a 50 MB package. For large archives over 200 MB, SFTP via FileZilla is faster and more reliable.

Step 4: Create a New Database on the New Host

Before running the installer, you need an empty database on the new host.

  1. In your new host’s cPanel, go to MySQL Databases.
  2. Create a new database — name it something recognizable (e.g., wpschool_db).
  3. Create a new database user with a strong password.
  4. Add the user to the database with All Privileges.
  5. Note the database name, username, and password — you’ll need all three in the next step.

Step 5: Run the Duplicator Installer

  1. In your browser, navigate to http://yournewdomain.com/installer.php.
  2. Accept the terms and click Next.
  3. On the Setup screen, enter your new database credentials: host (usually localhost), database name, username, and password.
  4. Click Test Database — you should see a green checkmark.
  5. Click Next to run the installation.
  6. When prompted, update the Site URL and Path fields to match your new domain/server path.
  7. Click Run Update.

You should see a “Installation Complete” screen with a link to your new WordPress admin. Log in using your existing credentials.

Step 6: Verify Before Changing DNS

Before pointing your domain to the new host, verify the site works correctly:

  • Check that all pages load
  • Test any contact forms or checkout pages
  • Confirm images are displaying
  • Log in to wp-admin and confirm plugins and theme are intact

To preview the site on the new host before DNS propagation, you can use a temporary URL provided by your host, or modify your local hosts file to point the domain to the new server’s IP.

Step 7: Update DNS

  1. Log in to your domain registrar (GoDaddy, Namecheap, Cloudflare, etc.).
  2. Update the A record to point to your new host’s IP address.
  3. DNS propagation takes 1–48 hours, though most registrars update in under 2 hours.

Once propagation completes, your domain resolves to the new host. Your migration is done.


Method 2: Manual Migration (No Plugin)

If your site is above the Duplicator free limit, you’re on a host that blocks migration plugins, or you just prefer direct control, manual migration works cleanly. It takes longer but has no file-size restrictions.

Step 1: Export Your Database

  1. Log in to phpMyAdmin on your current host (usually under cPanel > Databases > phpMyAdmin).
  2. Select your WordPress database from the left sidebar.
  3. Click the Export tab.
  4. Choose Quick export method, format SQL.
  5. Click Go.

Your browser downloads a .sql file. This is your entire database.

Step 2: Download All WordPress Files

Using FileZilla or your host’s file manager, download the entire contents of your public_html directory (or wherever WordPress is installed). This includes:

  • wp-content/ (themes, plugins, uploads)
  • wp-config.php
  • All other WordPress core files

On a 200 MB site, this download takes roughly 3–5 minutes via SFTP.

Step 3: Create a New Database and Import

On the new host:

  1. Create a new database and user via cPanel > MySQL Databases (same as in Method 1, Step 4).
  2. Open phpMyAdmin on the new host.
  3. Select your new empty database.
  4. Click the Import tab.
  5. Upload the .sql file you exported in Step 1.
  6. Click Go.

You should see “Import has been successfully finished” with a row count.

Step 4: Upload WordPress Files

Upload all downloaded WordPress files to the public_html directory on the new host via SFTP or file manager.

Step 5: Edit wp-config.php

This is the step most tutorials skip over. Your wp-config.php still references the old database credentials. You must update it before the site will work.

Open wp-config.php in a text editor (or directly in your host’s file manager) and update these three lines:

define( 'DB_NAME', 'your_new_database_name' );
define( 'DB_USER', 'your_new_database_user' );
define( 'DB_PASSWORD', 'your_new_database_password' );

Also verify DB_HOST — it’s almost always localhost, but some hosts use a different value (check your host’s documentation if the site errors after this step).

Step 6: Update Site URL in the Database (If Your Domain Changes)

If you’re moving to the same domain, skip this step. If your domain is changing, you need to run a search-replace on the database to update all URLs.

The safest method: install Better Search Replace (free) on the new site temporarily, run a search for the old domain and replace with the new domain, with “Run as dry run” unchecked. Confirm the row count, then delete the plugin.

Never run a raw SQL UPDATE query to replace URLs unless you know exactly what you’re doing — serialized data in WordPress won’t survive a naive string replace.

Step 7: Verify and Switch DNS

Same as Method 1, Steps 6–7: verify the site on the new host using a temporary URL, then update DNS.


Troubleshooting Common Migration Problems

Why is my site showing a “Error Establishing Database Connection” message?

This error means WordPress cannot connect to the database. Check wp-config.php and confirm DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST all match the credentials on the new host exactly — including capitalization. If credentials are correct, confirm the database user has All Privileges assigned in cPanel > MySQL Databases.

Why are images broken after migration?

Broken images after migration almost always mean the wp-content/uploads folder didn’t transfer completely. In our testing, this happens most often when upload aborts midway on large folders. Re-upload the uploads directory via SFTP and check for any partially-transferred files.

Why are my URLs redirecting incorrectly?

If you see redirect loops or wrong URLs, the siteurl and home values in the database are stale. Fix them directly: in phpMyAdmin on the new host, run:

UPDATE wp_options SET option_value = 'https://yournewdomain.com' WHERE option_name = 'siteurl';
UPDATE wp_options SET option_value = 'https://yournewdomain.com' WHERE option_name = 'home';

Replace wp_options with your actual table prefix if it’s different (check wp-config.php for $table_prefix).

Why does my admin login not work on the new host?

This is usually a cookie domain mismatch. Clear browser cookies completely, then try again at https://yournewdomain.com/wp-admin. If the problem persists, add this to wp-config.php temporarily:

define('COOKIE_DOMAIN', '');

Remove it once you’re logged in successfully.

My Duplicator installer shows a “Secure Hash Mismatch” error — what does that mean?

This error means the archive file was corrupted during upload. It’s common when uploading large files via cPanel’s file manager, which has a file size limit (often 256 MB). Re-upload using SFTP instead, which has no practical file size limit. After re-uploading, retry the installer.


After the Migration: What to Do Next

Once your new host is live and DNS has propagated, run through this checklist:

  1. Flush permalinks: Go to Settings > Permalinks and click Save Changes without making any edits. This regenerates the .htaccess file on the new server.
  2. Update your SSL certificate: If you’re on a host that provides free SSL via Let’s Encrypt (SiteGround, Cloudways, and most managed hosts do), activate it in your hosting panel for the new server. Don’t carry over an SSL cert from the old host.
  3. Test your contact forms and checkout if you run WooCommerce. Database table prefixes and plugin paths sometimes cause issues that only surface under real usage.
  4. Check Google Search Console: Add the new property if the domain changed, or verify the existing property still shows correct coverage data. No resubmission is needed if the domain stayed the same.
  5. Cancel your old hosting plan — but only after 48 hours post-DNS switch, once you’ve confirmed everything is working on the new host.

For sites on managed WordPress hosts like Kinsta or WP Engine, both offer free concierge migration as part of onboarding — a legitimate reason to pay for managed hosting if manual migration feels outside your comfort zone.


Frequently Asked Questions

Do I need to reinstall WordPress on the new host before migrating? No. Duplicator’s installer handles WordPress setup during the migration. For manual migration, you upload your existing files directly — no fresh install needed.

Will my SEO rankings drop after migration? Migrating to the same domain with no URL changes causes no SEO impact. If your new host is significantly faster, rankings can improve within 4–6 weeks as Google recrawls.

Can I migrate a WooCommerce store using these same methods? Yes. WooCommerce data lives in the WordPress database and wp-content folder like everything else. The migration process is identical. Run a test order after migration to confirm payment gateway credentials still work.

How long does DNS propagation take? Most DNS updates resolve within 1–4 hours for the majority of users. The technical maximum is 48 hours. You can check propagation status using a tool like whatsmydns.net.

Is it safe to migrate a live site? Yes, with one precaution: put your site in maintenance mode during the migration to prevent orders or form submissions on the old host that won’t exist on the new one. Use the free WP Maintenance Mode plugin for this.

What if my site is larger than 512 MB? Use Duplicator Pro ($69.99/year) or migrate manually. Both handle any file size. Duplicator Pro also splits large archives into multipart files, which avoids PHP timeout issues on shared hosting.

Do I need to update WordPress after migrating? No. Your WordPress version, plugins, and theme all carry over intact. Update them afterward through the normal Dashboard > Updates screen once you’ve confirmed everything is stable.

Should I delete the migration files after finishing? Yes. After confirming the site works on the new host, delete installer.php and archive.zip from public_html. Leaving them accessible is a security risk — the installer could be re-run by anyone who finds the URL.

Was this helpful?

Related Tutorials

Related posts will appear here once more tutorials are published.