RRowan RRowan - 5 months ago 20
MySQL Question

Wordpress - DB Migration causes accordion plugin content to reset/disappear

I am using this plugin https://wordpress.org/plugins/accordions/ and sent a question to the plugin author. https://wordpress.org/support/topic/db-migration-clears-accordion-content/

I have a problem when I migrate to another database. Using mysqlworkbench –
after I export, then upon import find and replace links – I see my website and all the accordion content clears and shows a message “Demo Content”. I believe it is when you change links in db that are in the accordion content it resets content.

Not sure how to fix this without having to copy and paste all the accordion content again...


Answer Source

The issue you've described isn't a flaw in the plugin. The plugin will be saving data in a serialized format. Your method of updating links via search / replace will break that serialization.

The codex page on "Moving WordPress" outlines this issue along with a list of options to correctly update the URLs.

If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break.


I'd recommend option #4, the search and replace script: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/