@welshdemon did you ever figure this out, I am pretty much doing – stuck exactly where you are. I am going for older bbpress to newer bbpress that is part of a full site update and just want to bring everything in cleanly. It does bring in my replies, and they seem to be connected properly in the backend, but frontend, they do not show.
If i edit a reply, and just hit the update button, it will then show. I want to avoid doing that 1000 times.
Even if I export the topics from the new site, that show properly after I did the update trick mentioned above, then bring it back in (wordpress import) to test if it will import properly, it does not, has same symptoms a you mentioned.
This is the first post I’ve found that accurately describes my predicament.
I am setting up a development site and attempting to import my forums via multiple XML files. However, the import process seems to be breaking a key relationship that allows the front-end of BBPress to work.
After importing, the Forums, Topics, and Replies all display correctly in the Dashboard, but on the front end I just get the standard “Oh bother! No topics were found here!” If I then run the Repair Tools “Recalculate the parent topic for each post” and/or “Recalculate the parent forum for each post,” then the relationship between Forums and Topics is lost, and the Replies page fails to load completely (returns an empty page with no error message).
From my digging around in the database, this problem seems centered around the field post_parent
in wp_posts
. On import, WordPress is setting this to “0” instead of the value in my XML file. If I click “Edit” on a Topic in the Dashboard and then click “Update” without changing anything, WordPress correctly repopulates this post_parent
value and the Topic appears on the front end under its parent forum. But like @bigt11 and @welshdemon, I don’t have time to do that with 1,200 Topics and 7,400 Replies.
Does anyone have any ideas? I have spent weeks trying to figure this out. I have tried multiple different XML import plugins, but none of them seem to word well with BBPress (or work with big XML files). Any help you can give here is very much appreciated!
It’s been almost 2 years, but I wanted to post my reply anyway because I think it can help someone.
Following @mikecostanzo insights, I built these SQL queries which repopulates the missing post_parent values successfully. Doing this a forum is reconnected with its topics, and topics are reconnected with its replies.
Remember that first, you need to import the forum, topics, and replies using WordPress importer. These actions import as well the involved users.
I applied this solution for a single forum but it can be used as a starting point modifying some parameters if required:
For topics:
UPDATE
wpmd_posts
INNER JOIN (wpmd_postmeta) ON (wpmd_posts.ID = wpmd_postmeta.post_id AND wpmd_postmeta.meta_key = ‘_bbp_forum_id’)
SET
wpmd_posts.post_parent = wpmd_postmeta.meta_value
WHERE
wpmd_posts.post_type LIKE ‘topic’
For Replies:
UPDATE
wpmd_posts
INNER JOIN (wpmd_postmeta) ON (wpmd_posts.ID = wpmd_postmeta.post_id AND wpmd_postmeta.meta_key = ‘_bbp_topic_id’)
SET
wpmd_posts.post_parent = wpmd_postmeta.meta_value
WHERE
wpmd_posts.post_type LIKE ‘reply’