bbPress has been around for a while, but when version 2 was released back in September 2011, it brought something entirely new to the table; it was no longer standalone software, but a plugin that fully integrates the forums into your WordPress installation. This is great on many levels, but it can be a nightmare if you need to remove bbPress, as I discovered.

A client of mine wanted to ditch their old phpBB forums in return for the fully integrated goodness of bbPress. The first battle, was figuring out how to get all of the users, topics, and replies over to the WP database. After many failed attempts by clunky forum conversion plugins, I found success with bbConverter. Although, as we quickly discovered, it too has its own flaws; we were left with 40k topics and 120k replies, but many had authors mixed up, were in the wrong place, or no longer belonged to a forum. Not to mention, bbConverter didn’t convert any of the bbCode used by phpBB, and didn’t do anything with file attachments. In short, the converted forums were a bloody mess and hardly useable. After a few days of trying to make the best of the situation, we decided to roll back and stick with phpBB.

Now I was faced with the task of cleaning up the database and removing the bbPress content. Surprisingly, there is no “uninstall” for bbPress, so I knew it was going to be a manual task. After digging through the database, I found that topics and replies are custom post types, which means they’re now part of the wp_posts table, where as all bbPress tables were previously independent, and prefixed with bb_. It’s not as simple as dropping a handful of tables and calling it a day. Topics and replies (and likely forums; I deleted them from WP-Admin as there was less than 20) are mixed in with the main posts, and other custom post types the site uses.

After half an hour of Googling, I found a solution on Stack Exchange. The only thing I had to do, was replace “customposttype” with the actual post type names, and change the table prefix (as it’s not the WP default).

Be sure to backup your database before running the following queries.

[sql]
DELETE a,b,c FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID=b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID=c.post_id)
WHERE a.post_type=’topic’
[/sql]
[sql]
DELETE a,b,c FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID=b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID=c.post_id)
WHERE a.post_type=’reply’
[/sql]

Those two queries cleared out the over 160k records found in the _posts table, and the associated data stored in the _postmeta and _term_relationships tables.

3 Comments

The conversions are definitely the worst part. I love bbP2, but if you aren’t starting from scratch it can be a real PITA.

Supposedly http://wordpress.org/extend/plugins/bbconverter/ is eventually going to have phpBB support, but it hasn’t gotten there yet.

Another thing to keep an eye out for is the Vanilla forums. There is currently a bridge being developed that does a pretty good job connecting WP to Vanilla. I’ve found that Vanilla is a good “in-between” option – not as simple and bbP but not as bloated as vB 🙂

I know bbConverter still says they’re working on phpBB conversion, but the plugin does actually support it currently. Clearly, not to its fullest potential, but the option is there within WP-Admin to convert from phpBB to bbPress.

I’ve been happy with bbPress, so far. Makeup Geek is now sporting BuddyPress as well, so it’s a bit of a beast, but absolutely full of awesome integration. One user account to rule them all!

Man, conversion is turning out to be a pain in the ass. Thanks for this tip though, as it seems that bbConvertor wasn’t clearing out the topics and such for me as I expected it too. Fingers crossed after having run these scripts things will go a bit smoother!

Comments are automatically closed on articles over 5 years old.