WordPress serialized meta data broken or missing

Last few weeks we had some issues with some sites from our clients, information was missing or gone in WordPress. We looked in the database and the data was still there.

We make use of the metabox plugin from metabox.io, for some metaboxes the data is stored as a serialized array in the database. Only the fields that where stored serialized went “missing”.
First we thought that it had something to do with old versions of the plugins, so we updated everything, still no data. After spending a day to find what was causing this problem and how to fix we called our hosting provider and restored a database backup.

Couple days later we got an other site with the same issue. This site was just a few days online and the test version that was filled by the client was still ok. So we compared the database and checked the serialized arrays. The serialized arrays on the production site where broken and could not be unserialized. The serialized string was not incomplete but was not equal to the serialized string from the test version of the site.

After some checks in the phpMyAdmin the test site was also missing some content for one or more pages.

We got a breakthrought with this issue!

phpMyAdmin is causing the error when you open the quick edit function for a database row column. The value is re-stored when you close the quick edit and then the serialized string is broken. Even when you copy-past values with the quick edit it goes broken.

I did not check with the default edit functionality in phpMyAdmin but i will do that and report this bug. In the main time, be carefull what you do in the phpMyAdmin with serialized fields!