The Ultimate WordPress Migration Guide: Manual & Plugin Methods
Moving a WordPress site from one host to another (or from local to live) is a core skill for any developer. While plugins make it easy for small sites, manual migration is often necessary for large, complex installations.
Phase 1: Preparation
Before touching anything, ensure you have:
- Access: FTP/SFTP and Database credentials for both the old and new hosts.
- No Caching: Turn off caching plugins (WP Rocket, W3TC) on the old site to prevent exporting cached files.
- Backup: Create a full backup of the old site.
Method A: The Plugin Route (Best for Small Sites < 500MB)
For standard brochure sites, plugins save time and handle the database search-replace automatically.
Recommended Plugins
- All-in-One WP Migration: Easiest UI, but has upload limits on the free version.
- Duplicator: More robust, creates a standalone installer package.
The Process (Duplicator)
- Install: Install Duplicator on the Old site.
- Build: Go to Duplicator > Packages > Create New. Scan and Build.
- Download: Download the
Installer.phpand theArchive.zipfiles. - Upload: Upload both files to the
public_html(or/var/www/html) folder of the New server. - Install: Navigate to
http://new-site.com/installer.phpin your browser. - Run: Follow the wizard. It will extract files and update the database URLs automatically.
Method B: The Manual Route (Best for Large Sites / Developers)
If your site is 5GB+, plugins will likely timeout. The manual method is faster, more reliable, and gives you full control.
Step 1: Export the Database (Old Host)
Use phpMyAdmin or the command line (CLI).
# CLI Method (SSH)
mysqldump -u db_user -p db_name > data.sql
Step 2: Download Files (Old Host)
Compress the wp-content folder. We generally do not need the core WP files (we will install fresh ones), just the content.
# SSH Method
tar -czf wp-content.tar.gz wp-content/
Download wp-content.tar.gz and data.sql to your local machine or transfer directly to the new server.
Step 3: Prepare New Host
- Install a fresh WordPress instance on the new server.
- Delete the
wp-contentfolder in the new installation.
Step 4: Upload and Extract
Upload your wp-content.tar.gz and data.sql to the new server.
# Extract content
tar -xzf wp-content.tar.gz
Step 5: Import Database
Warning: This overwrites the fresh install's database.
mysql -u new_db_user -p new_db_name < data.sql
Step 6: Update wp-config.php
Ensure the wp-config.php file on the new server has the correct database credentials (DB_NAME, DB_USER, DB_PASSWORD) and table prefix.
Phase 3: The Search & Replace (Crucial)
Your database still contains links to http://old-site.com. You must change them to http://new-site.com.
Do NOT run a simple SQL query. WordPress stores data in "Serialized Arrays" (PHP objects). A standard SQL replace will break widgets and theme settings because it changes the string length without updating the serialization length count.
The Tool: WP-CLI (Recommended)
If you have SSH access, this is the safest method.
# Dry run first
wp search-replace 'http://old-site.com' 'http://new-site.com' --all-tables --dry-run
# Execute
wp search-replace 'http://old-site.com' 'http://new-site.com' --all-tables
Phase 4: Final Checklist
- Permalinks: Go to Settings > Permalinks and click "Save Changes" to regenerate
.htaccess. This fixes 404 errors. - SSL: Ensure your SSL certificate is active.
- Caching: Re-enable your caching plugins and clear the cache.