WordPress Migration Guide: How to Move Hosts Without Downtime

WordPress Migration Guide: How to Move Hosts Without Downtime

Author: Edric Martinez, Lead Developer & WP Troubleshooter
Reading time: 12 minutes
Last updated: April 2025

Why Site Migrations Break

Moving a WordPress site to a new host should be simple. Export files, export database, import both, update DNS. Done, right?

If only.

In reality, migrations fail constantly. URLs break, images disappear, forms stop working, and suddenly your client’s business is offline. I’ve rescued dozens of botched migrations — from DIY attempts gone wrong to developer handoffs that missed critical pieces.

The difference between a smooth migration and a disaster comes down to process. Here’s the exact workflow I use for zero-downtime WordPress migrations.

Pre-Migration Checklist

Before touching anything, gather intel.

Document Everything

  • [ ] Current hosting control panel login
  • [ ] Domain registrar login
  • [ ] WordPress admin login
  • [ ] FTP/SFTP credentials
  • [ ] Database credentials (from wp-config.php)
  • [ ] Email hosting setup (don’t break email!)
  • [ ] SSL certificate source
  • [ ] CDN configuration (Cloudflare, etc.)
  • [ ] List of active plugins and their versions
  • [ ] Current theme name and version
  • [ ] PHP version on current host
  • [ ] MySQL version on current host

Check for Custom Configurations

Look beyond WordPress core:

  • Custom .htaccess rules
  • Nginx config snippets
  • Cron jobs
  • External API integrations
  • Custom drop-in plugins (object-cache.php, etc.)
  • Multisite? (Changes everything)
  • WooCommerce? (Needs special handling)
  • Multilingual? (WPML/ Polylang database tables)

Verify New Host Compatibility

Before migrating, confirm the new host supports:

  • Same or higher PHP version
  • Required PHP extensions (imagick, mbstring, etc.)
  • Same or higher MySQL version
  • SSL certificate installation
  • WordPress-specific features (if managed host)

Method 1: All-in-One WP Migration (Easiest)

For most sites under 2GB, this plugin is the fastest path.

Export on Old Host

  1. Install All-in-One WP Migration
  2. Go to All-in-One WP Migration → Export
  3. Choose “Export to File”
  4. Wait for the export (can take 10-30 minutes for large sites)
  5. Download the .wpress file

Import on New Host

  1. Install WordPress on new host
  2. Install All-in-One WP Migration
  3. Go to Import → Import from File
  4. Upload the .wpress file
  5. Let it restore everything (files + database + URLs)
  6. Update permalinks: Settings → Permalinks → Save

What Gets Handled Automatically

  • URL replacement in database
  • Serialized data (unlike manual SQL find/replace)
  • Plugin and theme files
  • Uploads directory
  • Database tables

Limitations

  • Free version has 512MB import limit
  • Large sites may timeout
  • Some hosts block the plugin (WP Engine, Kinsta)

Method 2: Duplicator Pro (Best for Large Sites)

For sites over 2GB or complex multisite setups, Duplicator Pro is the gold standard.

Create a Package on Old Host

  1. Install Duplicator Pro
  2. Go to Duplicator Pro → Packages → Create New
  3. Name your package (e.g., “Site-Migration-April-2025”)
  4. Let it scan (checks for issues)
  5. Build the package
  6. Download both files: installer.php and the archive

Deploy on New Host

  1. Upload installer.php and archive to new host root (public_html)
  2. Create a new MySQL database on new host
  3. Visit yoursite.com/installer.php
  4. Follow the wizard:
  • Extract files
  • Enter new database credentials
  • Run deployment
  • Update URLs
    1. Delete installer files when done

    Advantages Over All-in-One

    • No size limits
    • Better for complex setups
    • More control over the process
    • Can handle server-level configs

    Method 3: Manual Migration (Full Control)

    For developers who want complete control over every step.

    Step 1: Export Files

    Via SSH (fastest):

    bash
    cd /var/www/html
    tar -czvf backup-files.tar.gz .
    

    Via FTP/SFTP:
    Use FileZilla or rsync to download everything.

    Important files to grab:

    • All WordPress core files
    • wp-content/uploads/
    • wp-content/plugins/
    • wp-content/themes/
    • .htaccess
    • wp-config.php
    • Any custom config files

    Step 2: Export Database

    Via phpMyAdmin:

    1. Select database
    2. Export → Custom → Save output to file
    3. Check “Add DROP TABLE” for clean import

    Via WP-CLI:

    bash
    wp db export backup-database.sql
    

    Via command line:

    bash
    mysqldump -u username -p database_name > backup-database.sql
    

    Step 3: Import Files to New Host

    Upload files to new host’s public_html directory.

    Step 4: Create Database on New Host

    1. Create new MySQL database
    2. Create database user with full privileges
    3. Note the credentials

    Step 5: Import Database

    Via phpMyAdmin:

    1. Select new database
    2. Import → Choose file → Go
    3. Wait for import (can take time for large databases)

    Via command line:

    bash
    mysql -u new_username -p new_database < backup-database.sql
    

    Step 6: Update wp-config.php

    Edit wp-config.php with new database credentials:

    php
    define('DB_NAME', 'new_database_name');
    define('DB_USER', 'new_username');
    define('DB_PASSWORD', 'new_password');
    define('DB_HOST', 'localhost'); // Or new host's database server
    

    Step 7: Update URLs in Database

    This is the critical step most people miss.

    Option A: WP-CLI (fastest)

    bash
    wp search-replace 'https://old-site.com' 'https://new-site.com'
    wp search-replace 'http://old-site.com' 'https://new-site.com'
    

    Option B: SQL queries

    sql
    UPDATE wp_options SET option_value = replace(option_value, 'https://old-site.com', 'https://new-site.com') WHERE option_name = 'home' OR option_name = 'siteurl';
    
    

    UPDATE wp_posts SET post_content = replace(post_content, 'https://old-site.com', 'https://new-site.com');

    UPDATE wp_postmeta SET meta_value = replace(meta_value, 'https://old-site.com', 'https://new-site.com');

    Option C: Plugin
    Install Better Search Replace plugin and run a search/replace across all tables.

    ---

    Zero-Downtime DNS Cutover

    The scariest part of migration: switching DNS. Here's how to minimize downtime.

    Lower TTL Before Migration

    A few days before migration, lower your DNS TTL to 300 seconds (5 minutes). This ensures fast propagation when you switch.

    Test Before Going Live

    Method 1: Edit hosts file
    On your local computer, edit your hosts file:

    • Mac/Linux: /etc/hosts
    • Windows: C:\Windows\System32\drivers\etc\hosts

    Add:

    192.168.1.100 yoursite.com www.yoursite.com
    

    (Replace with your new server's IP)

    Now your computer loads the new site while the rest of the world still sees the old one. Test everything thoroughly.

    Method 2: Temporary URL
    Some hosts give you a temporary URL (e.g., server.host.com/~username). Test there first.

    Method 3: Staging subdomain
    Set up staging.yoursite.com pointing to the new server. Test, then switch the main domain.

    Perform the Cutover

    1. Update DNS A record to point to new server IP
    2. Wait for propagation (usually 5-30 minutes with low TTL)
    3. Check with multiple tools:
  • dig yoursite.com
  • nslookup yoursite.com
  • https://whatsmydns.net
    1. Monitor for 24-48 hours for any issues

    ---

    Post-Migration Checklist

    Don't assume it worked. Verify everything.

    Critical Checks

    • [ ] Homepage loads correctly
    • [ ] Admin login works
    • [ ] All pages accessible (check key pages)
    • [ ] Images load (not broken links)
    • [ ] Forms submit correctly
    • [ ] Shopping cart works (if WooCommerce)
    • [ ] SSL certificate active
    • [ ] Redirects working (if any custom rules)
    • [ ] Email sending works (contact forms, notifications)
    • [ ] Search functionality works
    • [ ] Mobile responsiveness intact

    Performance Verification

    • [ ] Page speed similar or better
    • [ ] Database queries not excessive
    • [ ] No PHP errors in logs
    • [ ] CDN configured (if using)
    • [ ] Caching active and working

    Security Checks

    • [ ] WordPress admin URL accessible only to you
    • [ ] File permissions correct (644 for files, 755 for directories)
    • [ ] No default admin user
    • [ ] Security plugin reconfigured for new environment

    ---

    Common Migration Problems and Fixes

    Problem: Images Not Loading

    Cause: URLs still pointing to old domain in post content.

    Fix: Run search-replace on post content and postmeta tables.

    Problem: Permalinks Broken

    Cause: .htaccess not copied or mod_rewrite not enabled.

    Fix:

    1. Go to Settings → Permalinks → Save (regenerates .htaccess)
    2. Check Apache has mod_rewrite enabled
    3. Verify .htaccess file exists and is writable

    Problem: "Error Establishing Database Connection"

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

    Fix:

    1. Verify DB_NAME, DB_USER, DB_PASSWORD, DB_HOST
    2. Check database user has correct privileges
    3. Confirm database host (some use 127.0.0.1 instead of localhost)

    Problem: Mixed Content Warnings (HTTP/HTTPS)

    Cause: Some URLs still using HTTP after switching to HTTPS.

    Fix:

    bash
    wp search-replace 'http://yoursite.com' 'https://yoursite.com'
    

    Problem: Plugin Licenses Broken

    Cause: Plugins tied to domain (some restrict activations).

    Fix:

    1. Deactivate license on old site
    2. Reactivate on new site
    3. Contact plugin support if needed

    ---

    Related Articles

    ---

    Conclusion

    WordPress migrations don't have to be stressful. The key is preparation: document everything, test before going live, and have a rollback plan.

    For most sites, All-in-One WP Migration or Duplicator Pro will handle the job safely. For complex setups, manual migration gives you full control. Either way, never skip the testing phase.

    Remember: DNS propagation takes time. Don't panic if the new site doesn't show immediately. Test with your hosts file first, verify everything, then make the DNS switch.

    ---

    Last updated: April 2025