Moving a WordPress site can fail for many reasons, but nearly all migration problems come down to a handful of causes: broken file paths, database connection errors, missing files, or server configuration mismatches. This article explains the most common WordPress migration issues and gives clear, step‑by‑step fixes you can apply yourself.
Why WordPress Migrations Fail
WordPress stores its content in two places: the files (themes, plugins, uploads) and the database (posts, pages, settings, users). A migration copies both to a new server or domain. Problems happen when the copy is incomplete, the paths in the database still point to the old location, or the new server’s PHP or database settings differ from what the site expects.
Most migrations are done with a plugin (like Duplicator, UpdraftPlus, or All‑in‑One WP Migration) or manually via FTP and phpMyAdmin. Each method has its own common failure points, but the fixes below cover the broad majority.
Common Problem: White Screen of Death After Migration
After moving a site, you may see a completely blank white page. This usually means PHP is crashing before it can output anything. The most frequent causes are:
- Missing or corrupted files (especially
wp-config.phpor thewp-contentfolder). - A plugin or theme that is incompatible with the new server’s PHP version.
- Incorrect file permissions (files should be 644, directories 755).
Fix: Enable WordPress debugging by adding these lines to wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
Then reload the page – the error message will appear. If it says “headers already sent� or mentions a specific plugin, deactivate that plugin by renaming its folder in wp-content/plugins via FTP. If the problem is PHP version, switch the new server to a compatible PHP version (most hosts let you do this in cPanel or a similar panel).
Database Connection Errors
“Error establishing a database connection� is one of the most common migration failures. It means WordPress cannot connect to the MySQL database on the new server. The causes are usually:
- The database name, username, or password in
wp-config.phpis wrong. - The database was not imported correctly, or the database user lacks proper privileges.
- The database host is incorrect (some hosts use
localhost, others use a hostname likemysql.example.com).
Fix: Open your wp-config.php file and verify the following constants:
define('DB_NAME', 'your_database_name');
define('DB_USER', 'your_database_user');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'localhost');
If you are unsure, check your hosting control panel for the correct database credentials. Also ensure the database has been imported – you can use phpMyAdmin to see if the tables exist. If the import failed, try importing the SQL file again, but make sure the file is complete (check the file size).
Broken Links and Images After Moving Domain
When you move a WordPress site to a new domain, the database still contains the old domain in URLs. This causes broken links, missing images, and problems with the admin area. The classic symptom: you log in to the new site, but the CSS is missing and images show a 404.
Fix: You need to update the site URL in the database. The safest method is to use a plugin like “Better Search Replace� or a migration plugin that does this automatically. If you prefer manual methods, you can run SQL queries in phpMyAdmin:
UPDATE wp_options SET option_value = 'http://newdomain.com' WHERE option_name = 'siteurl'; UPDATE wp_options SET option_value = 'http://newdomain.com' WHERE option_name = 'home';
But this only changes two options. For all other URLs (in posts, widgets, menus), you need a search‑replace tool. Be careful: if you do a direct SQL replace on serialized data (like widget settings), it can corrupt the data. That’s why a plugin like “Better Search Replace� is recommended – it handles serialized data correctly.
Redirect Loops or Login Issues
After migration, you might see a redirect loop when trying to access the admin area or the site itself. This often happens when the site URL in the database is different from the actual domain, or when a security plugin is blocking access because the IP has changed.
Fix: First, ensure the siteurl and home values in the database match your new domain exactly (including http or https). If you are using HTTPS, make sure the SSL certificate is installed and that you have updated the URLs to https://.
If a security plugin is causing the loop, temporarily rename its folder in wp-content/plugins to deactivate it. Also clear your browser cache and try a different browser.
Large Sites Time Out or Run Out of Memory
Migrating a large site (hundreds of images, large database) often fails because the server runs out of memory or the script times out. This is common with manual migrations or using plugins that process everything in one go.
Fix: Increase the PHP memory limit and execution time. You can add to wp-config.php:
define('WP_MEMORY_LIMIT', '256M');
set_time_limit(0);
If you are using a migration plugin, try splitting the migration: export the database separately, upload files via FTP (if possible), and then import the database. For very large sites, consider using a plugin that supports chunked uploads or a service that handles the transfer.
Frequently Asked Questions
Why does my WordPress site show “Error establishing a database connection� after moving?
This almost always means the database credentials in wp-config.php are wrong, or the database was not imported correctly. Double‑check the database name, user, password, and host, and confirm the tables exist in phpMyAdmin.
How do I fix broken images after moving my WordPress site?
Broken images are usually caused by old URLs in the database. Use a search‑replace plugin to update all instances of the old domain to the new one. Also ensure the uploads folder was fully copied to the new server.
Can I migrate WordPress manually without a plugin?
Yes. You can export the database with phpMyAdmin, copy all files via FTP, and then edit wp-config.php with new database details. After that, you must update the site URLs in the database. It’s more work but gives you full control.
What should I do if I get a “headers already sent� error after migration?
This error means there is extra whitespace or output before the PHP opening tag in a file – often in wp-config.php or a plugin file. Open the file in a text editor and remove any spaces or characters before <?php or after the closing tag.
Why does my migrated site look different (missing CSS) even though files are there?
Missing CSS usually means the theme’s stylesheet URL is wrong – often because the site URL in the database still points to the old domain. Update the siteurl and home options, and then clear any caching plugins.
Is it safe to use a search‑replace plugin on my database?
Yes, as long as you use a plugin that handles serialized data correctly (like “Better Search Replace�). Direct SQL replace on serialized data can corrupt it. Always back up your database before running any search‑replace.
Prevention Tips for Future Migrations
To avoid these problems next time, follow these best practices:
- Always back up both files and database before starting.
- Use a reputable migration plugin that handles URL replacements automatically.
- Check that the new server meets WordPress’s minimum requirements (PHP 7.4 or higher, MySQL 5.7 or higher).
- After migration, test every page, image, and form to ensure everything works.
- Keep a copy of the old site until you are sure the new one is stable.
Most migration issues are fixable with a bit of patience and the right tools. By understanding the underlying causes – file paths, database connections, and URL references – you can solve them quickly and get your site back online.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Delete Picture Kik? How to Remove Photos
- What Happens to X Replies, DMs, and Followers After Deletion?
- Data Breaches That Shook the World
- Disable Google Assistant: Turn It Off on Android & Home
- Resin vs FDM Printers for Miniatures: Detail, Durability, Cost
- Are Networked Implants Safe? What If One Fails?