15%

Save 15% on All Hosting Services

Test your skills and get Discount on any hosting plan

Use code:

Skills
Get Started
01.11.2024

How to Migrate a WordPress Site to Another Hosting (Complete Step-by-Step Guide)

Migrating a WordPress site to a new hosting provider can feel overwhelming, but with the right approach, it's a straightforward process that preserves every post, page, plugin, and database record. Whether you're upgrading to a faster server, switching providers for better pricing, or moving to a more powerful environment, this guide walks you through every step — from backing up your files to testing your live site on the new host.

Why Migrate Your WordPress Site?

There are many legitimate reasons to move a WordPress installation to a new hosting environment:

  • Performance upgrades — Moving to NVMe-powered VPS Hosting dramatically reduces page load times compared to shared environments.
  • Scalability — Your current host can't keep up with growing traffic.
  • Cost efficiency — Better resources at a lower monthly price.
  • Security improvements — Access to DDoS protection, firewalls, and isolated environments.
  • Full server control — Root access lets you configure PHP, NGINX, Apache, and caching layers exactly as needed.

Whatever your reason, following a structured migration process ensures zero data loss and minimal downtime.

Before You Begin: Pre-Migration Checklist

Rushing into a migration without preparation is the most common cause of data loss and extended downtime. Complete these steps before touching a single file:

1. Choose Your New Hosting Provider

Select a hosting plan that matches your site's current and future needs. Consider:

  • Storage type — NVMe SSD vs. traditional HDD
  • RAM and CPU allocation
  • PHP version support
  • Control panel availability (cPanel, Plesk, DirectAdmin)
  • Support quality and response time

If you're running a growing WordPress site, a VPS with cPanel gives you the flexibility of a dedicated environment with the familiarity of a graphical control panel — ideal for managing databases, files, and email accounts without command-line expertise.

2. Create a Complete Backup of Your WordPress Site

Never begin a migration without a verified, full backup. A complete WordPress backup consists of two components:

  • All WordPress files (themes, plugins, uploads, core files, and configuration)
  • The MySQL database (all posts, pages, settings, users, and metadata)

Both must be backed up and stored safely before proceeding.

Step 1: Back Up Your WordPress Files

Option A: Using an FTP Client (FileZilla)

  1. Download and install FileZilla (or any FTP/SFTP client of your choice).
  2. Connect to your current hosting server using your FTP credentials:
  • Host: your server IP or domain
  • Username: your FTP username
  • Password: your FTP password
  • Port: 21 (FTP) or 22 (SFTP — recommended for security)
  1. Navigate to your WordPress root directory — this is typically public_html/ or www/.
  2. Select all files and folders, including hidden files (e.g., .htaccess). In FileZilla, enable hidden file visibility under Server → Force showing hidden files.
  3. Download everything to a dedicated folder on your local computer.

Option B: Using Your Hosting Control Panel File Manager

  1. Log into your current hosting control panel (cPanel, Plesk, etc.).
  2. Open the File Manager.
  3. Navigate to public_html/ (or your WordPress root).
  4. Select all files, compress them into a .zip archive.
  5. Download the archive to your local machine.

> Pro tip: Verify the downloaded archive is complete and not corrupted before proceeding. An incomplete backup is as dangerous as no backup at all.

Step 2: Export Your WordPress Database

Your WordPress database contains everything that makes your site unique — all content, user accounts, settings, and plugin data. Exporting it correctly is critical.

Step 2.1: Access phpMyAdmin on Your Current Host

  1. Log into your current hosting control panel.
  2. Navigate to the Databases section and open phpMyAdmin.
  3. In the left sidebar, click on your WordPress database (the database name is listed in your wp-config.php file under DB_NAME).

Step 2.2: Export the Database

  1. Click the Export tab at the top of the phpMyAdmin interface.
  2. Select the Quick export method for a standard, complete export.
  3. Ensure the format is set to SQL.
  4. Click Go — phpMyAdmin will download a .sql file to your computer.

> Important: Keep this .sql file safe. It is the complete snapshot of your WordPress database and is irreplaceable without your original server.

Step 3: Upload Your WordPress Files to the New Host

With your files and database backed up locally, it's time to set up your new hosting environment.

Step 3.1: Connect to Your New Hosting Server

Use your FTP/SFTP client with the credentials provided by your new hosting provider. If you've chosen a VPS Hosting plan, you may also connect via SSH for faster file transfers using scp or rsync.

Using rsync over SSH (recommended for VPS users):

rsync -avz --progress /local/path/to/wordpress/ user@new-server-ip:/var/www/html/

This method is significantly faster than FTP for large sites and preserves file permissions.

Step 3.2: Upload All WordPress Files

  1. Navigate to the root web directory on your new server (typically public_html/ or /var/www/html/).
  2. Upload all files and folders from your local WordPress backup, including hidden files like .htaccess.
  3. Wait for the transfer to complete fully before proceeding.

Step 4: Create a New Database on the New Host

Step 4.1: Create the Database and User

  1. Log into your new hosting control panel.
  2. Navigate to MySQL Databases (or equivalent).
  3. Create a new database — choose a descriptive name (e.g., wp_newsite).
  4. Create a new database user with a strong password.
  5. Assign the user to the database with All Privileges.
  6. Note down the database name, username, and password — you'll need these shortly.

Step 4.2: Import the Database via phpMyAdmin

  1. Open phpMyAdmin on your new hosting control panel.
  2. Select the newly created database from the left sidebar.
  3. Click the Import tab.
  4. Click Choose File and select the .sql file you exported earlier.
  5. Leave all settings at their defaults and click Go.
  6. Wait for the import to complete — you should see a success confirmation message.

> Note: For large databases (over 50MB), phpMyAdmin may time out. In this case, use the command line on a VPS:

> “`bash

> mysql -u new_database_user -p new_database_name < /path/to/backup.sql

> “`

Step 5: Update wp-config.php

The wp-config.php file is the bridge between your WordPress files and your database. After migrating to a new server, you must update it with your new database credentials.

Locate and Edit wp-config.php

  1. In your new server's root WordPress directory, find the file named wp-config.php.
  2. Open it in a text editor (Notepad++, VS Code, or via SSH with nano).
  3. Update the following lines with your new database details:
define( 'DB_NAME', 'new_database_name' );
define( 'DB_USER', 'new_database_user' );
define( 'DB_PASSWORD', 'new_database_password' );
define( 'DB_HOST', 'localhost' ); // Usually 'localhost' — confirm with your host
  1. Save the file and upload it back to the server if you edited it locally.

> Security tip: While you have wp-config.php open, verify that your AUTH_KEY, SECURE_AUTH_KEY, and other secret keys are present. You can regenerate them using the WordPress Secret Key Generator.

Step 6: Update Domain DNS Settings

If you're keeping the same domain name but pointing it to a new server, you need to update your DNS records.

Step 6.1: Log Into Your Domain Registrar

Access the control panel where your domain is registered. If you haven't yet registered a domain or need to transfer one, Domain Registration through your hosting provider simplifies management by keeping everything in one place.

Step 6.2: Update Nameservers or A Records

You have two options:

Option A — Update Nameservers (recommended if switching hosting entirely):

  • Replace the existing nameservers with those provided by your new hosting provider.
  • Example: ns1.newhost.com and ns2.newhost.com

Option B — Update the A Record (if keeping your current DNS provider):

  • Update the A record for your domain (and www subdomain) to point to your new server's IP address.

Step 6.3: Wait for DNS Propagation

DNS changes can take anywhere from a few minutes to 48 hours to fully propagate worldwide. During this window, some visitors may still see the old site. To test your new site before DNS propagates, use your system's hosts file to point the domain to the new IP locally.

On Linux/macOS:

sudo nano /etc/hosts
# Add: NEW_SERVER_IP yourdomain.com www.yourdomain.com

On Windows:

Edit C:WindowsSystem32driversetchosts as Administrator.

Step 7: Install and Configure an SSL Certificate

Once your domain is pointing to the new server, secure your site with HTTPS. A valid SSL certificate is essential for user trust, data security, and Google search rankings.

If your new hosting plan doesn't include a free SSL certificate, you can obtain one through SSL Certificates — available in Domain Validation, Organization Validation, and Extended Validation tiers to suit any site type.

For VPS users, you can also install a free Let's Encrypt certificate using Certbot:

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

Step 8: Test Your Migrated WordPress Site

With DNS propagated and SSL configured, thoroughly test your site before announcing the migration is complete.

Essential Testing Checklist

TestWhat to Check
Homepage loadsCorrect content, images, and layout
Internal linksAll navigation links resolve correctly
Contact formsForm submissions work and emails are delivered
Media filesImages and videos display without broken links
Admin loginWordPress dashboard accessible at /wp-admin/
PluginsAll active plugins function correctly
SSL/HTTPSPadlock icon visible; no mixed content warnings
Page speedRun a GTmetrix or Google PageSpeed Insights test

After migration, WordPress permalink structures sometimes break. To refresh them:

  1. Log into your WordPress Admin Dashboard.
  2. Navigate to Settings → Permalinks.
  3. Click Save Changes (without changing anything) — this regenerates the .htaccess rewrite rules.

Step 9: Troubleshooting Common Migration Issues

Even with careful preparation, issues can arise. Here are the most common problems and their solutions:

Error: "Error Establishing a Database Connection"

Cause: Incorrect database credentials in wp-config.php.

Solution:

  • Double-check DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST in wp-config.php.
  • Confirm the database user has been granted full privileges on the database.
  • On some hosts, DB_HOST may not be localhost — check your hosting control panel for the correct hostname.

Error: Broken Images or Missing Media Files

Cause: Media files weren't uploaded, or WordPress is referencing the old domain's URLs.

Solution:

  • Verify all files in wp-content/uploads/ were transferred.
  • Use the Better Search Replace plugin to update old URLs in the database:
  • Replace: http://oldsite.com
  • With: https://newsite.com

Error: White Screen of Death (WSOD)

Cause: PHP errors, incompatible plugins, or memory limits.

Solution:

  • Enable WordPress debug mode in wp-config.php:
  define( 'WP_DEBUG', true );
  define( 'WP_DEBUG_LOG', true );
  define( 'WP_DEBUG_DISPLAY', false );
  • Check /wp-content/debug.log for error details.
  • Temporarily deactivate all plugins by renaming the plugins folder via FTP.

Error: 404 on All Pages Except Homepage

Cause: Permalink structure not regenerated after migration.

Solution: Go to Settings → Permalinks in WordPress admin and click Save Changes.

Error: Redirect Loop

Cause: SSL/HTTPS settings conflict, or siteurl/home values in the database point to the wrong URL.

Solution:

  • Update siteurl and home in the WordPress database via phpMyAdmin:
  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';

Choosing the Right Hosting for Your WordPress Site

The success of your migration also depends heavily on the quality of your new hosting environment. Here's a quick guide to matching your site's needs to the right plan:

Site TypeRecommended Hosting
Small blogs, personal sitesShared Web Hosting
Growing business sites, WooCommerceVPS Hosting
High-traffic, enterprise WordPressDedicated Servers
AI-powered or ML-integrated WordPressGPU Hosting

For most WordPress sites experiencing growth, a VPS is the sweet spot — offering dedicated resources, full root access, and the ability to fine-tune your PHP, NGINX, and caching configuration without the cost of a dedicated server.

Final Migration Checklist

Before you consider the migration complete, run through this final checklist:

  • [ ] All WordPress files uploaded to the new server
  • [ ] Database exported from old host and imported to new host
  • [ ] wp-config.php updated with new database credentials
  • [ ] DNS nameservers or A records updated
  • [ ] SSL certificate installed and HTTPS working
  • [ ] All pages, posts, and media files verified
  • [ ] Contact forms and email functionality tested
  • [ ] Permalinks refreshed in WordPress admin
  • [ ] Old site kept active until DNS fully propagates
  • [ ] Backup of the new site taken post-migration

Conclusion

Migrating a WordPress site to a new hosting provider is a manageable process when you follow a structured, step-by-step approach. The key pillars of a successful migration are: a complete backup before you start, careful database handling, accurate wp-config.php configuration, and thorough post-migration testing.

By moving to a high-performance hosting environment — whether that's a managed VPS, a cPanel-equipped server, or a dedicated machine — you're not just changing hosts. You're investing in faster load times, better security, and a more scalable foundation for your WordPress site's future growth.

Take your time with each step, verify your work at every stage, and your site will be live on its new home with minimal disruption to your visitors.

15%

Save 15% on All Hosting Services

Test your skills and get Discount on any hosting plan

Use code:

Skills
Get Started