Solution:
Most migration breaks are caused by bad serialised data.
The easiest way to repair these breaks is to Force Recreate the data. This achievable by forcing the plugin to rewrite the serialised data to the MySQL database.
Following these steps will help with most migration errors you may encounter:
- Deactivate and Reactivate all of your plugins
- Activate a different (preferrably a default / built-in) theme, and then reactivate your current theme.
- Head to Settings -> Permalinks and just click save (keep all your settings the same)
For anyone else reading this answer: It’s important to note that almost all of this would be impossible if your URL changed and you did not run the SQL fix mentioned in the question
If needed, I’ve added my own version of it below, you will just have to remember to replace the oldsite-url.com
and newsite-url.com
with relevant values.
If the database in question uses a custom table prefix (i.e. not wp_
), you will need to remember to find -> replace that as well.
Here’s the SQL Query:
UPDATE wp_options SET option_value = replace(option_value, 'http://oldsite-url.com', 'http://newsite-url.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, 'http://oldsite-url.com', 'http://newsite-url.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://oldsite-url.com', 'http://newsite-url.com');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://oldsite-url.com','http://newsite-url.com');