Home>Support>Solution: How to fix broken Page Builder after database migration and/or site transfer Or direct change to database

Solution: How to fix broken Page Builder after database migration and/or site transfer Or direct change to database

By Paul, 10 years ago. Last reply by Diogo Calçada, 8 years ago.

** This solution should work for people who broke their page builder site by making a change directly to the database AND people who broke their page builder site doing a database export/import **

A couple days ago, I attempted to transfer a site using Page Builder via database import/export. At the time, I was not aware that you had to use WordPress export/import to preserve Page Builder. I was devastated to see that much of the site was broken (blank page). I knew the page builder data was still there. I googled and googled and found no solution. All signs pointed to having to recreate the site. After looking at the code for a little bit, I concluded the issue most likely had to do with serialization.

Obviously, if you still have access to the old site, the best solution is to use WordPress export on the old site, then DROP the database on the NEW site, reinstall wordpress, and import the aforementioned export.

However, for those of us that aren’t so lucky, I have found a solution:
** Before doing this, I highly advise you take a database backup in case something goes wrong **
Step 1. Identify the affected pages/posts and note their id.
Step 2. Do a WordPress export that includes all of your pages/posts and open it with a good text editor like NotePad++.
Step 3. Login to phpAdmin and go to your WordPress database.
Step 4. Go to the postmeta table (usually wp_postmeta unless you have a custom table prefix).
Step 5. Use the search to find each page/post. The field you want to search is post_id. For example, I am going to search for post_id=1 since my home page is broken and has the page id 1.
Step 6. You are going to need to do the following for each item that page builder uses in the search results except for _edit_lock, _edit_last … For the home page, the only keys I had to copy were ‘panels_data’ and ‘_wp_page_template’.
Step 7. In the edit form, copy all the contents of meta_value.
Step 8. Go back to the xml file we opened in Step 2 and locate the affected page/post. For example, I am looking for ‘Home’.
Step 9. Find the section under the found page/post ” (create it if it doesn’t exist just before ”) and add a subitem under it ‘panels_data’ (you may also want to delete the existing items).
Step 10. Now add one more subitem directly under the subitem made in step 9:
‘<![CDATA[ ]]’.
Step 11. Paste the copied contents from step 7 in between the ‘CDATA[‘ and ‘]]’.
Step 12. Repeat 6 – 11 (BUT NO delete on step 9) for each required meta key.
Step 13. Repeat 5-12 for all affected pages/posts.
Step 14. Delete all affected pages and posts. Make sure you empty the trash, too. This is to retain page/post ids, permalinks, titles, and prevent duplications.
Step 15. Now save the xml file and import it into WordPress.

This seems daunting and there are a lot of steps, but this is actually pretty easy. It only took me about 1 minute per page , which is a lot better than recreating each page!

I just wanted to post this solution because I know that horror you feel when your site has broken. I hope this solution will help some people out of a jam :-)

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 10 years, 1 month ago Paul

    Just another quick note: A lot of this could be automated fairly easy. For example, you could make a php script that queries the postmeta table for all the affected pages/posts and then loop through this to generate the entire wp:postmeta section.

  2. 10 years, 1 month ago Paul

    Arrr! Looks like my post was stripped of important information. I am too tired to try to point out what … maybe a moderator could fix it. I have wasted enough time due to poor design!

  3. 10 years, 28 days ago Andrew Misplon
    Hi, I Work Here

    Hi Paul

    Apologies for missing your thread, it slipped through during an usually busy period. We do appreciate your input on this matter.

    I’ll be sure to pass your solutions onto Greg. As you know, for the moment only WordPress XML export and Duplicator plugin can do a clean move: https://wordpress.org/plugins/duplicator/.

    Thanks again for the effort you put in here.

  4. 8 years, 3 months ago Diogo Calçada

    Paul, I can’t thank you enough for this.

    You’ve saved hours of my life. Thank you!

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More