Moving from bbPress 1 to 2 is a pain in the neck. It’s really like migrating from one forum software product to another. It’s not an evolution but a revolution. In use, bbPress 2 is not much better than bbPress 1 but since John James Jacoby pushed version two out the door in 2011, it’s long since time to migrate. The issue with bbPress 1 is not with the software itself (still simple and scaleable) but with plugins.
John James Jacoby forced all the bbPress v1 plugins underground (info and plugin repository were moved over to v2). Unlike almost anything else new in the WordPress world, bbPress 2 is neither crippleware (useless free version with pro version) or serviceware, so we are grateful for bbPress.
The 263 reasons we all have to upgrade to bbPress 2
We’re not the only ones to have mixed feelings about this migration and come late to it. WordPress.org is still using (as we speak), bbPress 1. WordPress.org has decided to migrate now so we’re publishing our experience with complex bbPress 1 migrations to bbPress 2 to help them. Here’s the grim details.
How to Migrate from bbPress 1 to 2
Since bbPress 2 provides a database conversion tool in Tools -> Forums -> Import, the switch from bbPress 1 doesn’t seem like a big trouble. If you run a customized forums, just like WordPress.org does, then you forum conversion might turn into a big job, just like the forum conversion on WordPress.org did.
Handling bbPress 1 Customisations
Our conversion was even harder as in our forums we allowed:
- Guest posting – we really hate when you have to register before posting, why not just register the user using his email address? In bbPress version 1 we customized the bb-post.php file to allow this.
- Nicer forum permalinks – using bbPress 1 plugin nicer-permalinks/nicer-permalinks.php
- we don’t like the bbPress default URL structure. As see on WordPress.org: /support/topic/{topic-slug}
- what we are after is /support/{plugin-name}/{topic-slug}
- Forum moderation – since we allow guest posting it much needed. We also get a fair amount of support requests where users post their client websites and don’t want their URLs to be revealed. This used a bbPress 1 plugin bb-moderation-hold/moderation.php
To bring these functions to our new forums we created FV bbPress Tweaks. The plugin is currently pending approval for WordPress.org plugin repository, you can get it from our Github repository.
Conversion steps
The following steps are not perfect, as we did only around 3 forum conversions with it and only 1 forum (ours) had the moderation enabled, but it will give you some good tips of what to do and what not to do.
Our bbPress database version was 2078, some of these issues might be fixed if you had a newer version.
-
Store IDs of replies that are pending moderation and approve them. This is needed as the bbPress 2 importer doesn’t handle these at all. Use the SQL:
select post_id from bb_posts where post_status = -1; # store this!
update bb_posts set post_status = 0 where post_status = -1;
-
Store IDs of topics and replies that are deleted. Use the SQL:
select topic_id from bb_topics where topic_status = 1 # store this!
select post_id from bb_posts where post_status = 1 # also store this! - Because the bbPress 1 forum used a plugin for moderating of the replies the post positions were handled incorrectly and the export was broken all the time. Use this script: Fix bbPress 1 post positions (Note: it actually requires bbPress 1 to run)
- Use the actual bbPress import tool: Tools -> Forums -> Import. Since we fixed some of the structural issues in steps 1, 2 & 3, the import should work fine.
- Run this script to mark the deleted topics and replies as trash and put back information about moderated replies: bbPress 1 to bbPress 2 cleanup tool
- Fix the forums slugs to not have number post-fixes because of duplicity. In our forums we have the same “Troubleshooting” sub-forum for each plugin (forum), but there is no reason to append the number into the forum slug as there is hierarchical structure:
- Create backup of DB.
-
Use the following SQL to figure out which forums slugs have to be correted:
SELECT * FROM `wp_posts` WHERE post_type='forum' AND (post_name REGEXP '^(.*)-[0-9]')
- …and just correct the post_name fields as required
- Once finished visits Settings -> Permalinks to refresh the rewrite rules
- Mark pending topics from step 1 and pending. We only had a couple of these, so it was done by hand.
- Migrate the user topic subscriptions. On the old bbPress forums we used a plugin which utilized the favorite topic function. Use this PHP code to move it over to bbPress 2 subscriptions: Convert bbPress 1 favorite topics into topic subscriptions in bbPress 2
And as the last step put up FV bbPress Tweaks.
We hope this helps. Feel free to ask any questions here or to use our FV bbPress Tweaks software. We’re open to adding improvements to bbPress Tweaks to make life easier for bbPress administrators. Long live bbPress 2!
Martin Viceník
Martin graduated as an engineer in Computer Science from Slovak Technical University in Bratislava. He grew up in Liptovský Mikuláš in northern Slovakia next to the beautiful Tatra mountains. He is the developer behind our FV Player.
Leave a Reply