Migrating phpBB

Migrating the phpBB forum

Activate Forum Module

You will need to activate the Forum module in Drupal core.  There may be other modules you will want to activate (ie. upload, poll, profile) but Forum is required.

Once you have activated the Forum module, you will have a new content type: Forum Topic.  I would recommend going to Administer -> Content Management -> Content Types and editing the Forum Topic type.  Make sure attachments are enabled, and adjust the comment settings as follows:

  • Default comment settings: Read/Write
  • Default display mode: Flat list - expanded
  • Default display order: Date - oldest first
  • Comment controls: Display below comments
  • Comment subject field: Disabled (I disable this because otherwise Drupal will ALWAYS use an excerpt from the first line as a subject field.  Can this be turned off for empty subject lines via a module???)
  • Preview comment: up to you.  I have it optional.
  • Location of comment submission form: Display below posts or comments
  • Image attachments on comments: Display as full image
  • Attachments on comments: Enabled

Create Forum Moderator Role (Optional)

While this is optional, and could be done later, I recommend going to Administer -> User Management -> Roles and creating a role named Forum Moderator (or something along those lines.)  Be sure to give this role any appropriate permissions for moderating the forum (more permissions will be added as we progress.)

Install Initial Modules

With your Drupal installation ready, install the following modules:

and while you're at it, go ahead and install Better Formats.

Update permissions for Privatemsg (give moderators access.)

  1. Go to Administer -> Site Configuration -> Input Formats and create a new input format named something like Forum Input Format and allow it to use the BBCode filter (and any others you want) and make sure all roles have access to it.
  2. Go to Administer -> Site Configuration -> Input Formats and click the Settings tab.  Check the 'Control formats per node type' box and save.
  3. Go to Administer -> Content Management -> Content Types and edit the Forum Topic type.  Expand the Input format settings and make the default type for this node "Forum input format" or whatever you created above in step 1.

Set Migration Settings

Go to Administer -> Site Configuration -> phpBB2Drupal Settings.  This will bring up a number of settings that must be set in order to import and migrate the phpBB data.

  1. This is a very risky operation.  Your Drupal database WILL be altered, making it possible the entire site could go down.  Be sure you back things up (definitely backup your database before trying ANYTHING like this!!!)  Because of the risk, you have to set the checkbox agreeing that this is either a demo site or you are confident enough to continue.
  2. Specify the location of the phpBB database.  By default, phpBB2Drupal assumes the phpBB data is in the same database as Drupal.  I prefer using separate databases as it is cleaner, and if something goes wrong, it is less likely to damage something else.  While the phpBB database should be safe during the migration, I strongly recommend making a backup.  I also recommend importing this backup into a temporary database, if possible, to use for the migration.  This will prevent anything bad from happening to the existing forum.  Anyway, to use the separate database, uncheck the 'phpbb is on the same database as drupal' box and save the configuration.  Enter the correct path of the phpBB database, including the username and password, and save the configuration again.  If you mis-type the database path, you will receive the Site Off-line error page.  See notes below for how to fix this.
  3. You may want to edit the import time limit or user import settings (I leave them alone.)
  4. Set the Input Format settings to Forum Input Format (or whatever you named it.)
  5. You can leave the BBCode as is, since you'll be using the BBCode module.
  6. Check the 'import attachments' box and save the configuration.
  7. You may now click the 'proceed with migration' link

NOTES:

If you mistyped the phpBB database path in step 2 above and are getting the Site Off-line error page, you can't fix this through the settings.php file like you would if there was a problem with Drupal's database.  The only way I have found to fix this is to go into phpMyAdmin and edit Drupal's database.  Look for the 'variable' table (I use 'drupal_' as a prefix for the tables, so mine is drupal_variable.)  Delete the entry named phpbb2drupal_db_url and edit phpbb2drupal_same_db to set it back to true (change the 0 to a 1.)  Clear Drupal's cache and go back into the phpBB2Drupal settings.  Now make sure to type it correctly!!!

Proceed With Migration

With all of the settings correct, you may click the 'proceed with migration' link from the phpBB2Drupal Settings page.  The migration is done in steps where you select what you want to migrate, then click the Import button.  I would often get an error about a table 'system' not existing.  If you get a white page with just the error message, try going back and importing again.  If you get the long error message but you have the drop-down box and import button below it, you're actually probably ok...  Just go through the following steps:

  1. Import Users
  2. Import Categories
  3. Import Topics
  4. Import Posts
  5. Transform URLs

The import process can take quite some time, depending on how big your forum was.

Post Migration

After you have finished the migration steps, you will be given a link to the post migration configuration.  This can also be access through Administer -> phpBB to Drupal -> Post Migration Configuration.  This tells you what to do in order to finalize the migration process.  Basically:

  1. Go to Administer -> User Management -> User Settings.  Enable signatures and pictures and adjust any other settings (i.e. max picture size, default picture, etc.)
  2. Go to Administer -> Site Building -> Themes and enable 'User pictures in posts' and 'User pictures in comments' under general settings.
  3. If allowing polls in the forum, go to Administer -> Content Management -> Taxonomy.  Edit the Forum vocabulary by checking the 'Polls' box.

If you don't have your phpBB installation in <Drupal_path>/forums, you can go to path_to_drupal/forum to view your imported forum.  In the next section, we'll take care of fixing things up.