Tutorials

How to Migrate Your WordPress Site to a New Host

Muhammad SaadApril 17, 20266 min read
How to Migrate Your WordPress Site to a New Host

Whether your current host is too slow, too expensive, or you've simply outgrown it, migrating your WordPress site to a new host is something every site owner faces eventually. The good news: with the right approach, you can move everything — content, database, plugins, themes — with zero downtime.

Here's the complete process, from backup to DNS switch.

Before You Start

What you'll need:

  • Access to your current hosting account (cPanel or SSH)
  • Your new hosting account set up and ready
  • FTP client (FileZilla) or SSH access to both servers
  • About 30-60 minutes, depending on site size

Important: Don't cancel your old hosting until the migration is fully verified and working.

Method 1: Plugin Migration (Easiest)

For most WordPress sites under 1GB, a migration plugin is the fastest approach.

Using All-in-One WP Migration

  1. Install the plugin on your current site:

Go to Plugins → Add New → search "All-in-One WP Migration" → Install → Activate

  1. Export your site:

Go to All-in-One WP Migration → Export → Export To → File

This creates a single .wpress file containing everything — database, media, plugins, themes, and settings.

  1. Install WordPress on your new host:

Most hosts offer one-click WordPress installation. Set it up with a temporary URL or your domain (we'll handle DNS later).

  1. Install the same plugin on the new WordPress installation.

  2. Import your site:

Go to All-in-One WP Migration → Import → drag and drop the .wpress file.

Limitation: The free version has a ~512MB import limit. For larger sites, use the paid version ($69) or Method 2.

Using Duplicator

Duplicator is another excellent option, especially for larger sites:

# Duplicator creates two files:
# 1. installer.php — the migration script
# 2. archive.zip — your entire site
  1. Install Duplicator on your current site
  2. Go to Duplicator → Packages → Create New
  3. Download both the installer and archive files
  4. Upload both files to your new host's root directory via FTP
  5. Visit yournewhost.com/installer.php in your browser
  6. Follow the wizard — enter your new database credentials
  7. Done

Method 2: Manual Migration (Full Control)

For developers or sites where plugins aren't an option, manual migration gives you complete control.

Step 1: Back Up Your Database

# Via SSH on your current host
mysqldump -u username -p database_name > backup.sql

# Or via phpMyAdmin:
# 1. Open phpMyAdmin
# 2. Select your WordPress database
# 3. Click "Export" → Quick → Go

Step 2: Download Your Files

# Via SSH — compress everything first
cd /var/www/html  # or your WordPress root
tar -czf wordpress-backup.tar.gz .

# Then download
scp user@oldhost:/var/www/html/wordpress-backup.tar.gz ./

Or use FTP to download the entire public_html or www directory.

Step 3: Upload to New Host

# Upload the compressed archive
scp wordpress-backup.tar.gz user@newhost:/var/www/html/

# SSH into new host and extract
ssh user@newhost
cd /var/www/html
tar -xzf wordpress-backup.tar.gz

Step 4: Create Database on New Host

# Via SSH
mysql -u root -p
CREATE DATABASE wordpress_db;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'strong_password_here';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 5: Import Database

mysql -u wp_user -p wordpress_db < backup.sql

Step 6: Update wp-config.php

Edit the config file on your new host to match the new database credentials:

define('DB_NAME', 'wordpress_db');
define('DB_USER', 'wp_user');
define('DB_PASSWORD', 'strong_password_here');
define('DB_HOST', 'localhost');

Step 7: Update URLs (If Domain Changed Temporarily)

If you're testing on a temporary URL before switching DNS:

# Using WP-CLI
wp search-replace 'https://oldsite.com' 'https://newsite.com' --all-tables

# Or via MySQL
UPDATE wp_options SET option_value = 'https://newsite.com' WHERE option_name = 'siteurl';
UPDATE wp_options SET option_value = 'https://newsite.com' WHERE option_name = 'home';

Step 8: Fix Permissions

# Set correct ownership
sudo chown -R www-data:www-data /var/www/html/

# Set correct permissions
find /var/www/html -type d -exec chmod 755 {} \;
find /var/www/html -type f -exec chmod 644 {} \;

Testing Before Switching DNS

This is crucial — test everything before pointing your domain to the new host.

Edit Your Hosts File

Force your computer to load the new server without changing DNS:

Mac/Linux:

sudo nano /etc/hosts
# Add this line:
123.456.789.0  yourdomain.com  www.yourdomain.com

Windows:
Edit C:\Windows\System32\drivers\etc\hosts as administrator.

Replace 123.456.789.0 with your new server's IP address. Now when you visit your domain, you'll see the new server.

Test checklist:

  • Homepage loads correctly
  • All pages and posts work
  • Images display properly
  • Contact forms submit
  • WooCommerce checkout works (if applicable)
  • SSL certificate is installed
  • Admin dashboard is accessible
  • Plugins are functioning

Remove the hosts file entry after DNS switch.

Switching DNS

Once testing confirms everything works:

  1. Log into your domain registrar (GoDaddy, Namecheap, Cloudflare, etc.)
  2. Update nameservers or A record to point to your new host:
Type: A
Name: @
Value: YOUR_NEW_SERVER_IP
TTL: 300 (5 minutes for fast propagation)

Also update the www record:

Type: CNAME
Name: www
Value: yourdomain.com
TTL: 300
  1. Wait for propagation — DNS changes can take up to 48 hours, but usually complete within 1-4 hours.

Check propagation status at dnschecker.org.

Post-Migration Checklist

After DNS has propagated:

  • Install SSL certificate on new host (sudo certbot --nginx -d yourdomain.com)
  • Test all site functionality again
  • Update Google Search Console with any changes
  • Check Google Analytics is still tracking
  • Clear all caches (browser, CDN, WordPress cache plugin)
  • Run a speed test to compare performance
  • Set up automated backups on new host
  • Remove hosts file entries from testing
  • Monitor for 48 hours before cancelling old host
  • Cancel old hosting (don't forget this — avoid double billing)

Common Migration Issues

White screen after migration: Usually a PHP version mismatch. Check your new host's PHP version matches what your plugins require.

Broken images: Run search-replace to update URLs in the database. Images may reference the old domain.

Database connection error: Double-check wp-config.php credentials match your new database setup exactly.

Permalink issues: Visit Settings → Permalinks in WordPress admin and click Save (regenerates .htaccess).

Mixed content warnings: Some URLs may still reference http://. Run a thorough search-replace.

Migrate with Confidence

WordPress migration doesn't have to be stressful. Whether you use a plugin for simplicity or go the manual route for full control, the key is testing thoroughly before switching DNS. Take your time, follow the checklist, and your visitors won't notice a thing.

At DeployBase, we make migrations painless. Our team offers free migration assistance with every hosting plan — we'll move your WordPress site for you with zero downtime. Combined with our fast SSD hosting, free SSL, and automated backups, your site will feel right at home from day one.

Migrate to DeployBase today → — free migration included with every plan.

Share this article

Muhammad Saad

Muhammad Saad

DeployBase Team

Ready to Get Started?

Join thousands of developers who trust DeployBase for their hosting needs.

View Plans