Key takeaways
- Table of Contents
- Before migration: prepare yourself
- Step 1: Back up your complete site
Changing hosting providers is a decision most WordPress site owners eventually face. Whether for reasons of performance, cost, support, or features, migration is a process that can seem intimidating. The good news? With the right methodology, you can migrate your WordPress site to a new host without any service interruption.
In this article, we guide you step by step through the migration process, from preparation to post-migration monitoring, including recommended tools and errors to avoid.
Before migration: prepare yourself
Preparation is the key to a successful migration. Here's what you need to do before even starting:
Pre-checks
- Verify technical requirements of the new host (PHP version, MySQL, disk space)
- Note your current configuration: PHP version, installed extensions, database size
- List your dependent services: email, DNS, CDN, SSL certificate
- Choose the right time: migrate during a low-traffic period
- Inform your team: if multiple people administer the site
Choosing the new host
Before migrating, make sure your new host meets your needs:
- Disk space: sufficient for your current files and future growth
- Bandwidth: suited to your traffic
- Technical support: responsive and competent, especially in case of migration issues
- Automatic backups: for your peace of mind
- Geographic location: close to your main audience
Step 1: Back up your complete site
Before any migration operation, create a complete backup of your site. This is your safety net in case of problems.
What to back up
- All WordPress files: themes, plugins, uploads, system files
- The complete database: all tables, without exception
- Configuration files: wp-config.php, .htaccess
- Emails if you use your host's email services
Backup methods
- Backup plugins: UpdraftPlus, BackupBuddy, WP-Clone
- Control panel: most hosts offer complete backups
- FTP + phpMyAdmin: manual but reliable method
- WP-CLI: for advanced users
"Never start a migration without a backup. A backup takes you 15 minutes; a complete restoration can take hours."
Step 2: Configure the new hosting
Before migrating your data, you need to prepare your new hosting:
- Create an account on your new host
- Install WordPress: most hosts offer one-click installation
- Check the PHP version: it must be compatible with your plugins and themes
- Create a database: note the credentials (username, password, database name)
- Enable SSL: make sure the SSL certificate is installed
Tip: Don't deactivate your old hosting during this step. Both servers must run simultaneously.
Step 3: Migrate files
Transfer all your WordPress files to the new hosting. There are several methods:
Method 1: Via control panel
Many hosts offer built-in migration tools. If your old host offers an export, use it.
Method 2: Via FTP
- Connect to your old server via FTP
- Download all files from the WordPress root
- Connect to the new hosting
- Upload all files to the root directory
Method 3: Via SSH
For advanced users, SSH is the fastest method:
tar -czvf backup.tar.gz /path/to/wordpresson the old serverscp backup.tar.gz user@new-server:/path/to/wordpress/tar -xzvf backup.tar.gzon the new server
Method 4: Via plugin
Plugins like Duplicator or All-in-One WP Migration greatly simplify the process. They create a complete package that you just need to install on the new server.
Step 4: Migrate the database
This is the most critical step. The database contains all your content, settings, and configurations.
Database export
- Connect to phpMyAdmin on your old hosting
- Select your WordPress database
- Click on the "Export" tab
- Choose "Quick" and SQL format
- Click "Go" to download the .sql file
Database import
- Connect to phpMyAdmin on the new hosting
- Select the database you created
- Click "Import"
- Select your .sql file
- Click "Go"
Modifying wp-config.php
After import, you need to modify the wp-config.php file to point to the new database:
define('DB_NAME', 'new_database_name');
define('DB_USER', 'new_user');
define('DB_PASSWORD', 'new_password');
define('DB_HOST', 'localhost');
You must also update the table prefix if different, and verify URLs in the wp_options table.
Step 5: Test before switching
Before switching your DNS, test your site on the new hosting. This is the most important step to avoid problems.
How to test without switching DNS
- Hosts file modification: edit your computer's hosts file to point to the new IP
- Browser extension: use an extension like "Host Switcher" to test
- Temporary URL: some hosts offer a temporary URL for testing
Test checklist
- ✅ The site displays correctly
- ✅ All pages are accessible
- ✅ Images and media load
- ✅ Forms work
- ✅ Admin login works
- ✅ Permalinks are correct
- ✅ Emails are functional
- ✅ SSL is active
- ✅ Redirects work
Step 6: Switch DNS
Once all tests are validated, you can switch your DNS records to the new hosting. This is the moment when your site officially moves to the new server.
DNS modification
- Log in to your domain registrar
- Modify the A records to point to the new IP
- Update the NS record if necessary
- Save changes
DNS propagation
DNS propagation can take 24 to 72 hours, although it's usually much faster (a few hours). During this period:
- Some visitors will see the old site, others the new one
- Don't modify your site during propagation
- Use a tool like
whatsmydns.netto check propagation - Keep your old hosting active until you confirm the new site works correctly for all visitors
Important tip
To reduce downtime, lower your DNS TTL 48 hours before migration (for example to 300 seconds). This will speed up propagation during the switch.
Step 7: Verify and clean up
After DNS propagation, verify that everything works correctly on the new hosting:
Post-migration checks
- Test the site from different devices and browsers
- Check error logs on the new hosting
- Test performance with GTmetrix or PageSpeed Insights
- Verify emails: sending and receiving
- Check SSL: valid and active certificate
- Test forms: contact and transactional pages
Cleanup
- Delete old backups on the old hosting
- Deactivate old hosting after confirming everything works
- Update URLs in your database if necessary (use Better Search Replace)
- Optimize your database with WP-Optimize
Recommended migration tools
Here are the tools we recommend to simplify your migration:
Migration plugins
- Duplicator: creates a complete package of your site (files + database). Ideal for complete migrations.
- All-in-One WP Migration: simple interface, export/import in a few clicks. Excellent for beginners.
- WP Migrate: advanced migration with URL and path management. Ideal for developers.
- UpdraftPlus: backup and restoration, with integrated migration
Diagnostic tools
- phpMyAdmin: database management and modification
- WP-CLI: command line for advanced operations
- Query Monitor: query and error analysis
- Better Search Replace: bulk URL modification
Rollback plan
Even with impeccable preparation, problems can occur. Always have a rollback plan in place before you begin the migration process.
In case of problems
- Don't panic: you have a complete backup
- DNS rollback: restore old DNS records in case of critical problems
- Contact your old host: make sure the old site is still active
- Identify the problem: check logs, test each component
- Fix and retry: resolve the issue before retrying migration
"A rollback plan isn't a sign of pessimism; it's a mark of professionalism. The best experts always have a Plan B."
Common errors to avoid
Most frequent errors
- Forgetting the backup: the most serious and most avoidable error
- Not testing before switching: always verify on the new hosting
- Migrating during peak hours: choose a low-traffic period
- Forgetting redirects: old URLs must redirect to new ones
- Neglecting SSL: verify the certificate is active after migration
- Forgetting emails: verify emails still work
- Not cleaning the database: optimize after migration
- Forgetting cron jobs: verify scheduled tasks work
- Missing cron jobs: scheduled tasks like backups or newsletter sends may break after migration if the cron system isn't properly configured on the new server
- Not checking plugin licenses: some premium plugins validate licenses based on the domain, and a server change can trigger deactivation
Conclusion
Migrating a WordPress site to a new host is not an operation to take lightly, but it's quite manageable with the right methodology. By following these steps and taking the time to properly prepare each phase, you can migrate your site without service interruption.
At WpDefender, we perform WordPress migrations for our clients securely and professionally. Our team handles every detail so you can focus on your business.
Need help migrating your WordPress site?
Our team handles your migration securely, without downtime and without data loss.
Related articles: 15 optimizations to speed up WordPress | Caching plugins comparison | Troubleshooting WordPress errors