A BB page was saved a few days ago and disappeared for no apparent reason. The content is empty in the posts table, but there is still a record of the BB content in the postmeta table. Is there a way I can restore this post? Also wondering what might cause it to disappear in the first place and why revisions are not showing. Thanks.
Thanks for getting in touch and sorry to hear about this problem. These kinds of issues usually arise upon migration of a site from one domain to another without using a search and replace tool that handles serialized data. Is this the case here? If not, we might need temp admin access to the site that you can send via private reply.
Thanks for the reply. Yes and no on the migration question. Using a hosts.cx temporary redirect URL for clients to view and edit the site, and using migrate db pro to replace the urls with the correct ones in the db. Should handle the serialized data. I have my hosts file pointed to the correct server using the permanent url on my computer. Page is missing no matter which url the site is viewed/edited at. Is there any way to get the post data out of the postmeta table and into the posts table?
As Ben mentions, it sounds like the migration didn’t quite go as planned. Have you tried running it again? Migrate DB Pro is a good one, but just to test and ensure the migration does replace all URLs correctly, you could try Better Search and Replace. Let us know how it goes!
I tried that one too after reading a suggestion on a similar forum post here, but nothing changed. There are not that many pages missing so if there is a way to rescue the data from the postmeta table, I think that would be the quickest way to go at this point. Thanks.
Did you create a template for the pages by chance? Also, you mentioned above revisions aren’t showing for you? That is super weird, but if it’s a new site, that is why as there aren’t any! Anyway, is the older site that you migrated from still live to where you could try the migration process again? It could be that the database got corrupted from point A to B somehow.
There should be revisions on the pages. Not sure why there are not. Pages have been edited and changed several times. The migration is not from another site, just from a temporary URL to the permanent one because my clients can only use the temp url until the permanent URL is pointed at the server.
The files and db are in the same location no matter which URL is being used. I am doing the migrations to keep the db clean and updated with the right URLs. All other data is as it should be. Not sure if the missing revisions have anything to do with BB, but would really like to get them out of the postmeta table and back to regular pages in the posts table.
Do you mind sending in the site URL you are having this problem on as well as temp admin access so we can check? If you could also include what page is missing or any other information you think might help that would be great. You can use the private reply option below.
You are right in that the data is still intact on the postmeta table. All Page Builder data are stored there, more information on that here. Also, there is a problem with the serialization of the data on that page, I can’t say for any other pages since there were a lot. It’s also using the live site URL as well(going to post more details in a private reply). I would suggest taking a backup of the DB and running the serialized search and replace script. You could also run the Better Search Replace plugin since it’s based on the same script.
I have tried several times to fix the serialized data using Migrate DB Pro and the Better Search Replace plugin, but may need to go in and fix it manually. My guess is that the number of characters is wrong in the serialized data. Since there are not that many missing pages, I will probably change manually. Can you point me to the right place(s) in the postmeta entry to make the changes? Most of the BB pages are still working as they should and just needed to be saved again to bring them back.
Ha, you beat me to it. Thanks! The site will go live in a few days, and the problem is limited to a few BB pages, so I will fix them individually. The temp URL is actually doing redirects from the real URL so having the real URL in the db works in all other situations. I will definitely backup the db!
That works as well. Really sorry about the corrupted serialized data. I haven’t really used any plugins when migrating sites so I really can’t recommend any. But for your case, you need not transfer the files/DB but just do a search and replace so I’m pretty sure the script or the plugin provided above should work just fine. And yes, never forget to take a backup of the DB when modifying it.
Ben filled me in on the issue and I read up on the previous posts here. It looks like some how the serialized data was modified incorrectly at some point causing the string lengths to differ from the ones that are saved. Once that happens, there’s usually no going back unless you have a backup (which is always a good thing :)).
We’ve used Migrate DB Pro successfully as have many others, so I’m not sure the issue is there. Are you positive that no standard search/replace was done on the database?
One idea I have that might possibly fix this is to do a standard search/replace on the existing database to change the current URLs back to the original URLs. That might correct the serialized string lengths as it sounds like they are still expecting strings that contain the original URLs.
Give that a shot and let us know if it helps. Be sure to do a backup of your database before doing so.