Page missing but content is still in the postmeta table

Hi,

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.

Hey Lori,

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.

Ben

Hi Ben,

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?

Hey Lori,

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!

Best,
Billy

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.

Hey Lori,

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.

Best,
Billy

There is no template for the pages.

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.

Hey Lori,

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.

Ben

[Content Hidden]

Hey Lori,

I’m sorry but I can’t seem to login? I just hit the login button up the top and the credentials you sent doesn’t work. I also tried going to /wp-admin but to no avail. Could you check?

Ben

Sorry! Created the credentials and forgot to add the user. Should work now.

Thanks! It’s working now. Also, you mentioned you just change the URLs from the temp to the live one. Have you done that already? If so, what is the temp URL and what is the live URL?

Ben

No, the nameservers for the live url are still pointed at the old site. The live URL is only working on my computer because I pointed it to the new server in my hosts file.

Hey Lori,

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.

Ben

[Content Hidden]

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!

Hey Lori,

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. :slight_smile:

Ben

That find replace script is awesome! I have fixed as many serialization errors as I can find but still can’t get the page content back.

Hi Lori,

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.

Thanks,
Justin