How to Migrate WordPress from Another Website

How to Migrate WordPress from Another Website

Moving a WordPress site from one host or domain to another sounds intimidating, but it is mostly a matter of copying two things carefully: your files and your database. Get those two pieces right, point your domain to the new location, and the rest is testing. This guide walks through both the easy plugin route and the hands-on manual route so you can pick whichever fits your comfort level.

When and why to migrate

There are a handful of common reasons people move a WordPress install. You may be switching to faster hosting, consolidating several sites under one provider, moving from a staging or development environment to production, or rebranding to a new domain name. Whatever the reason, the goal is the same: an identical, working copy of your site running in its new home with zero data loss.

Pre-migration checklist and backup

Before you touch anything, take a complete backup. This is non-negotiable. A migration that goes sideways is recoverable in minutes if you have a backup, and a nightmare if you do not.

  1. Back up all files in your WordPress directory (themes, plugins, uploads, core).
  2. Export a full copy of the database.
  3. Note your current PHP and MySQL versions so the new server matches.
  4. Make a list of plugins and their versions.
  5. Confirm you have FTP/SFTP credentials and database access on the new host.

Keep your old site live and untouched until the new one is fully verified. Never delete the source until the destination is confirmed working.

Method 1 — Using a migration plugin

For most people, a migration plugin is the fastest and safest path. Tools in this category (such as Duplicator, All-in-One WP Migration, or Migrate Guru) all follow the same three-step pattern regardless of which one you choose.

  1. Package: On the source site, install the plugin and let it bundle your files and database into a single downloadable archive (and, in some cases, an installer script).
  2. Upload: Move that archive to the new server, either by uploading it through the plugin’s interface on a fresh WordPress install or via FTP into the web root.
  3. Install: Run the installer, which unpacks your files and imports the database into the new host. Most installers will offer to update the site URL for you automatically.

This approach handles the tricky search-and-replace step for you, which is why it is so popular for first-time migrations.

Method 2 — Manual migration

A manual move gives you full control and avoids plugin size limits on large sites. It has more steps, but none of them are difficult.

  1. Export files via FTP: Connect to the old server and download the entire WordPress folder to your computer.
  2. Export the database: Open phpMyAdmin on the old host, select your database, choose Export, and save the SQL file.
  3. Create a new database: On the new host, create a fresh database, a database user, and assign that user full privileges. Write down the name, user, and password.
  4. Upload files: Transfer the WordPress folder to the new server’s web root via FTP.
  5. Edit wp-config.php: Update the database constants to match the new credentials.
  6. Import the database: In phpMyAdmin on the new host, select the empty database and import your SQL file.
  7. Search-replace site URLs: Update old URLs to the new domain throughout the database.

The database constants in wp-config.php look like this:

define( 'DB_NAME', 'your_new_db_name' );
define( 'DB_USER', 'your_new_db_user' );
define( 'DB_PASSWORD', 'your_strong_password' );
define( 'DB_HOST', 'localhost' );

When updating URLs in the database, prefer a serialization-aware tool (like WP-CLI’s search-replace or a dedicated plugin) over a blind SQL query. A raw query can corrupt serialized PHP arrays:

-- Caution: this naive query can break serialized data.
-- Only use on simple fields, or use a serialization-safe tool instead.
UPDATE wp_options
SET option_value = REPLACE(option_value, 'http://old-site.com', 'https://new-site.com')
WHERE option_name IN ('siteurl', 'home');

Update URLs and permalinks

After importing, log into the new dashboard, go to Settings > General and confirm the WordPress Address and Site Address are correct. Then visit Settings > Permalinks and click Save once. This flushes the rewrite rules so your internal links resolve properly.

Point the domain and DNS

Once the site loads correctly via the new server’s address or a temporary URL, update your domain’s DNS A record (or nameservers) to point at the new host. DNS changes can take anywhere from a few minutes to 48 hours to propagate worldwide, so plan for a window where both copies might briefly be reachable.

Test everything

  • Click through internal links and the main navigation.
  • Confirm images and media load (broken images usually mean a missed URL replacement).
  • Submit a contact form to verify email delivery.
  • Check that SSL is active and the padlock shows on every page.

Post-migration cleanup

Delete any migration plugins and leftover installer files from the web root, since these can be a security risk. Remove the temporary backup archives, set up fresh scheduled backups on the new host, and only after a few days of confirmed stability should you decommission the old site.

Troubleshooting tips

  • White screen of death: Usually a PHP error or memory limit. Enable WP_DEBUG in wp-config.php and check the error log; deactivate plugins by renaming the plugins folder.
  • Mixed content warnings: Some assets still load over http://. Run a search-replace from http to https and update hard-coded links.
  • 404 errors on every page but the homepage: Re-save your permalinks and confirm the rewrite rules (and .htaccess) transferred correctly.