Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Moving from BBPress 2.0

edited July 2012 in Vanilla 2.0 - 2.8

I currently run a fairly large forum (9,000 users) on BBPress 2.0 and I am migrating over to Vanilla. I need to keep the users on Wordpress, for various things, but I am using SSO.

I am trying to import the old forum posts into Vanilla and I find myself perplexed. I found the exporter, but it only uses BBpress 1.0 -- I tried it for kicks and it just errors out, "no topics, no replies".

I think I could export the forum topics manually but I'm not sure how I'd go about importing them. Would I have to somehow automatically generate all of the existing users on Vanilla? Since they don't have a userID if they've never logged in, right?

I've spent a good three hours researching this tonight and I'm at a little lost. this is my last step and I'd really like to go forward. I don't mind getting my hands dirty but I need a little direction.


  • Options

    I'm in the same case, did you find a way to migrate from BBpress 2 ?

  • Options
    hgtonighthgtonight ∞ · New Moderator

    @Shain It looks like BBpress 2 is a complete change from BBpress 1. I don't have an install available to test, but from some searches, it looks to share tables with a wordpress install. :(

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    businessdadbusinessdad Stealth contributor MVP

    @hgtonight said:
    Shain It looks like BBpress 2 is a complete change from BBpress 1. I don't have an install available to test, but from some searches, it looks to share tables with a wordpress install. :(

    I have inspected a converter to migrate BBPress 1 data to version 2, and indeed there have been several changes. In best case, it would be a matter of replacing table names and fields (eventually splitting some data here and there to multiple tables). In worst case, a brand new library would have to be implemented. It's not the best of news, but it's not a trivial tasks (especially because it's crucial that data is imported correctly, a "more or less" result is not acceptable).

  • Options

    @businessadd‌ @hgtonight‌ Yes it looks like the tables are shared, I am trying to migrate my forums over and do not have a table called "bb_forums" which is why I'm getting error 1024 when using the vanilla porter.

    Has there been any additional insight gained since the last post back in March 2013?

    Sorry for the bump.

  • Options
    peregrineperegrine MVP
    edited December 2014


    you could try , if you don't solve it yourself or get other solutions...


    Skisma previously said: Can I migrate all existing forums/topics/users to vanilla once installed, or do I have to start fresh? This wouldn't be too big a deal if I cannot since the forums have only been open one week, but it would be ideal.

    If it were me I would start fresh, instead of converting, since it is only a week old. And you won't have to worry about any conversion issues that could arise.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    edited January 2015

    I used the following to import Users, Categories, Discussions and Replies. My role mapping is simplified because that is all I needed, and I hardcoded a prefix in a meta key value. 'wp_user_level' maybe something else if you use a different prefix than 'wp_'. Also no private messages, because I left them in BuddyPress. But its a start. You need to insert this code into the vanilla2export.php file:

     * bbPress2 exporter tool
     * @copyright Vanilla Forums Inc. 2010
     * @license GNU GPL2
     * @package VanillaPorter
    $Supported['bbPress2'] = array('name'=>'bbPress 2', 'prefix' => 'wp_');
    $Supported['bbPress2']['features'] = array(
       'Comments'        => 1,
       'Discussions'     => 1,
       'Users'           => 1,
       'Categories'      => 1,
       'Roles'           => 1,
       'PrivateMessages' => 1,
       'Passwords'       => 1,
    class BbPress2 extends ExportController {
       /** @var array Required tables => columns */
       protected $SourceTables = array(
          'posts' => array(),
          'users' => array('ID', 'user_login', 'user_pass', 'user_email', 'user_registered')
        * Forum-specific export format.
        * @param ExportModel $Ex
       protected function ForumExport($Ex) {
          // Begin
          $Ex->BeginExport('', 'bbPress 2.*', array('HashMethod' => 'Vanilla'));
          // Users
          $User_Map = array(
          $Ex->ExportTable('User', "select * from :_users", $User_Map);  // ":_" will be replace by database prefix
          // Roles
             "select 1 as RoleID, 'Guest' as Name
             union select 2, 'Key Master'
             union select 3, 'Administrator'
             union select 4, 'Moderator'
             union select 5, 'Member'
             union select 6, 'Inactive'
             union select 7, 'Blocked'");
          // UserRoles
          $UserRole_Map = array(
             "select distinct
               case when meta_value = 10 then 2
               when meta_value > 5 then 3
               when meta_value > 2 then 4
               when meta_value = 2 then 5
               when meta_value = 1 then 6
               when meta_value = 0 then 1
               else 1 end as RoleID
             from :_usermeta
             where meta_key = 'wp_user_level'", $UserRole_Map);
          // Categories
          $Category_Map = array(
          $Ex->ExportTable('Category', "select *,
             lower(post_name) as forum_slug,
             nullif(post_parent,0) as ParentCategoryID
             from :_posts where post_type = 'forum'", $Category_Map);
          // Discussions
          $Discussion_Map = array(
          $Ex->ExportTable('Discussion', "select t.*,
                'Html' as Format,
                0 as Closed
             from :_posts t where post_type = 'topic'", $Discussion_Map);
          // Comments
          $Comment_Map = array(
             'ID' => 'CommentID',
             'post_parent_id' => 'DiscussionID',
             'post_content' => array('Column'=>'Body', 'Filter'=>'bbPressTrim'),
             'Format' => 'Format',
             'post_author' => 'InsertUserID',
             'post_date' => 'DateInserted'
          $Ex->ExportTable('Comment', "select p.*,
            CASE WHEN post_type = 'topic' THEN ID 
            ELSE post_parent END as post_parent_id,
                'Html' as Format
             from :_posts p where post_type = 'topic' or post_type = 'reply'", $Comment_Map);
          // End
  • Options

    ^ The features array in the above code is inaccurate. It doesn't have PrivateMessages support and I doubt it successfully imports passwords either. I didn't need the passwords as I set up SSO with WordPress and jsconnect and jsconnect auto.

  • Options

    Thanks for sharing anyway, maybe someone can use this to build a full porter class.

  • Options

    @Bleistivt‌ They could do that. My motivation for pointing out the errors and limitations, was partly to help prevent disappointment on the part of users, and partly to provide other developers with the clues they need to complete the work. It is much better to have an almost complete bit of code than nothing at all. Especially when what needs doing is well documented. B)

  • Options

    Is there any progress on this project? I'm looking to do exactly this!

Sign In or Register to comment.