The Wild

How to Migrate a WordPress Site to Another Hosting

· 5 min read · Mammals

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Migrating a WordPress site to a new hosting provider means moving all your files, database, and settings so your site works exactly as before on the new server. This guide covers two methods: using a plugin (easiest) and doing it manually (more control). You'll need FTP access or a file manager, phpMyAdmin (or similar), and the new hosting credentials. No coding skills required.

What You'll Need

  • Access to your current hosting control panel (cPanel, Plesk, etc.)
  • FTP client (like FileZilla) or file manager in cPanel
  • phpMyAdmin or database export tool on old host
  • New hosting account with FTP and database credentials
  • Domain name access (to update DNS or nameservers)
  • Backup of your WordPress files and database (we'll create one)

Step-by-Step

Method 1: Using a Plugin (Recommended for Most Users)

  1. Install a migration plugin on your current site. Popular choices: UpdraftPlus, Duplicator, or All-in-One WP Migration. For this guide, we'll use UpdraftPlus (free version works).
  2. Create a full backup in the plugin: go to Settings > UpdraftPlus Backups, click "Backup Now", and include both files and database. Wait for it to complete.
  3. Download the backup to your computer: in the plugin's "Existing backups" tab, click the download icon for each component (files and database). Save them in a folder.
  4. Set up your new hosting: create a new database and user in your new hosting control panel (e.g., cPanel > MySQL Databases). Note the database name, username, and password.
  5. Install WordPress on the new host (if not already). Most hosts have a one-click installer. If you already have WordPress, you can skip this and just overwrite files.
  6. Upload the backup files to the new server via FTP. Connect to your new host using FTP, go to the public_html (or www) directory, and upload the entire contents of your old site's wp-content folder and other files (if you have a full backup). If you used UpdraftPlus, you'll upload the backup files into a temporary folder, but easier: use the plugin's restore feature after installing WordPress.
  7. Restore the backup: on the new site, install and activate UpdraftPlus, go to Settings > UpdraftPlus Backups, click "Restore" and upload the backup files you downloaded. The plugin will restore files and database.
  8. Update wp-config.php with new database details. If the plugin didn't do it automatically, edit wp-config.php (in the root folder) and change DB_NAME, DB_USER, and DB_PASSWORD to the new values.
  9. Update the site URL (if needed). If your domain is the same, no change. If using a temporary URL, you'll need to update it later.
  10. Test the new site by visiting it with a temporary URL (if provided) or by editing your local hosts file. Check that pages load, images show, and login works.

Method 2: Manual Migration (Full Control)

  1. Back up files: Use FTP to connect to your old host and download the entire WordPress folder (usually public_html).
  2. Export the database: In phpMyAdmin (old host), select your WordPress database, click "Export", choose "Quick" or "Custom" with gzip compression, and download the SQL file.
  3. Create a new database on the new host and import the SQL file: in phpMyAdmin (new host), select the new database, click "Import", choose the SQL file, and run it.
  4. Upload files to the new host via FTP into the correct directory (e.g., public_html).
  5. Edit wp-config.php with new database credentials (name, user, password, and host if different).
  6. Update URLs in the database if you changed domain or moved to a subdirectory. Use a SQL query in phpMyAdmin or a search-replace tool (like WP-CLI or Better Search Replace plugin) to replace old domain with new one.
  7. Test the site on the new host before switching DNS.

Common Mistakes

  • Forgetting to update wp-config.php with new database credentials – causes connection errors.
  • Not updating the site URL in the database when moving to a different domain or subdirectory – results in broken links and login issues.
  • Uploading files to the wrong directory (e.g., not public_html) – site appears blank.
  • Skipping the backup or not verifying it – if migration fails, you lose data.
  • Not disabling caching plugins before backup – may cause stale content.
  • Changing nameservers before testing – leads to downtime.

Tips

  • Always create a fresh backup right before migrating, not an old one.
  • Use a staging environment on the new host if available to test before going live.
  • Keep a copy of the backup on your computer and cloud storage.
  • If your site has a lot of media, use a plugin like UpdraftPlus to handle large files efficiently.
  • After migration, update your DNS or nameservers at your domain registrar, but wait until the new site is fully tested.
  • Consider using a migration plugin that handles URL changes automatically (e.g., Duplicator).

Troubleshooting

  • White screen after migration: Check wp-config.php for correct database credentials. Enable WP_DEBUG in wp-config.php to see errors.
  • Database connection error: Verify database name, user, and password. Also check the DB_HOST (sometimes it's not 'localhost').
  • Links broken or images missing: Run a search-replace on the database to update old domain to new one. Use a plugin like Better Search Replace.
  • Login redirects back to old site: Clear your browser cache and cookies. Also update the site URL in wp-admin (if you can log in) or via phpMyAdmin in the wp_options table.
  • Site shows "Error establishing a database connection": Double-check database credentials and that the database exists on the new host.
  • Permissions issues: Set file permissions to 644 for files and 755 for directories (via FTP).

Frequently Asked Questions

Do I need to change my domain's nameservers?

If you're moving to a new host, yes – you'll need to update your domain's nameservers to point to the new host. This can take 24-48 hours to propagate.

Can I migrate without downtime?

Yes, if you migrate to a staging site first, test it, then switch DNS. There may be a brief period during DNS propagation, but your old site stays live until you switch.

Will my SEO rankings be affected?

If you keep the same domain and URLs, and set up proper redirects (if URLs change), SEO impact is minimal. Use a plugin like Redirection to handle 301s.

What if my site is too large for a plugin?

Use the manual method with FTP and phpMyAdmin. Or use a plugin that supports split backups or increase PHP memory limits.

Do I need to reinstall WordPress on the new host?

No, you can just upload your existing files and database. However, many hosts require you to create a database first.

How long does the migration take?

It depends on site size and method. Plugin method can take 10-30 minutes; manual may take a few hours if you're not familiar.