Updating wbb 1.2 to phpbb 2 / 3
For my work I have merged Woltlab Burning Board (wbb) 1.2 to phpbb 2 (that of course can then be updated to phpbb 3).
My environment is PHP5 and MySQL 5. Some problems I’ve been facing could possibly be *not* apearing on older installations of PHP/MySQL.
What you need for that is:
- The WBB 1.1.1 to phpbb 2.0.0 Updater | MIRROR
- Of course your old Installation of WBB 1.2
- A NEW, PLAIN Installation of phpBB 2.0.0. You need 2.0.0, you can update that later to 2.X or 3.
The phpBB 2.0.0 installation didn’t work correctly because I’m using MySQL 5 (the installation worked (during the setup just check MySQL 4.x when you’re asked) but I e.g. couldn’t log in) but I don’t think this is going to be a problem.
What you have to do first (after installing phpBB 2.0.0) is to make the images / avatars and images / smilies wirteable by the webserver (chmod 777/700 on suPHP servers).
Now we do the important change. Since the converter is natively made for WBB 1.1.X , you have to make the following changes:
(Codechange #1) Find every line that contains _data.inc.php in import.php and change it to admin/_data.inc.php. There should only be two lines with that path, so not much to change.
(Codechange #2) Then you have to edit the beginning of import.php and set the correct paths. Only edit this first 3-4 lines !
Afterwards upload the files (import.php and import_db.php) to your WBB folder on the server.
Now go to yourdomain.com/yourwbbfolder/import.php in your browser.
If you are receiving this error right now: ERROR: Unable to find wBB global.php include.
Check path defines. You either didn’t do Codechange 1 or 2.
Now click on Start Import.
Then do the next step.
If you receive any error like: “Forumname: All Forums need a category” which I did quite a few times, do that:
(Databasechange #1) You have to edit the WBB boards table (e.g. with phpmyadmin) in that way, that every forum has a parent.
That means we need to edit the “boardparentid” for each board that is displayed to us in the error message (after you fixed one and refreshed the importer you might probably get that error again for another forum). For me it worked to just set “boardparentid” to 1 for every board. Of course that configuration is then wrong after the update, because not every board was having 1 as parent when we started, but we can change that later in the new forum.
Then we go for the next step:
You will get an error: * Deleting existing users :: OK
Fatal error: Cannot access empty property in …../webs/Max1/hwsboard/import_db.php on line 81
(Codechange #3) As this is a “normal” PHP parse error, we can simply fix this by finding the wrong code, which is the following in import_db.php :
$this->free_result($this->$query_id);
This of course has to be:
$this->free_result($this->query_id);
Reupload the files and you will get some further.
After that I got: * Converting moderators ::
Database error in WoltLab Burning Board: Invalid SQL: SELECT objectid, boardid FROM bb1_object2board WHERE mod = ‘1′
Unfortunately I couldn’t really find a fix for that as this seems to be a problem because I’m using MySQL 5 and all the scripts are just old.
The easiest way to get round this is to comment that part in import.php out.
(Codechange #4)
So put this:
// Moderators convert
print ” * Converting moderators :: “;
flush();
$user_mods = array();
$moderators = $DB_site->query(“SELECT objectid, boardid FROM bb”.$n.”_object2board WHERE mod = ‘1′”) or die_nice(“Unable to get moderators”);
while (list($objectid,$forumid) = $DB_site->fetch_array($moderators)) {
$user_mods[] = $objectid;
$group_query = $db->sql_query(“SELECT group_id FROM ” . USER_GROUP_TABLE . ” WHERE user_id=”.$objectid) or die_nice(“Unable to get group_id for user”);
list($groupid) = $db->sql_fetchrow($group_query);
$db->sql_query(“INSERT INTO ” . AUTH_ACCESS_TABLE . ” (group_id, forum_id, auth_mod) VALUES ($groupid, $forumid, 1)”) or die_nice(“Unable to insert moderators”);
}
// Update user_level for users that are moderator
if (count($user_mods)) {
$sql = “UPDATE ” . USERS_TABLE . ”
SET user_level = ” . MOD . ”
WHERE user_id IN (” . implode(“, “, $user_mods) . “) AND user_level <> ” . ADMIN;
$db->sql_query($sql) or die_nice(“Couldn’t update user levels to moderator”);
}
into /* …. */. This means that moderator information is not going to be updated and we have to reassign moderators manually afterwards.
The next step is topics. It worked just as is for me.
Then posts. Then polls.
* Importing polls ::
ERROR: Unable to insert poll options
That again isn’t too difficult to fix.
(Codechange #5)
Find that part in import.php:
while ($opt = $DB_site->fetch_array($opt_query))
{
$ins_opt_sql = “insert into phpbb_vote_results (vote_id, vote_option_text, vote_result) values (” . $poll[pollid] . “, ‘” . addslashes($opt['field']) . “‘, ” . $opt['votes'] . “)”;
$db->sql_query($ins_opt_sql) or die_nice(“Unable to insert poll options”);
}
(Or simply search for Unable to insert poll options in import.php)
We can easily see that “Insert Into phpbb_vote_results …” can’t be correct. That query isn’t using our defined prefix for the phpBB DB but just the default. So change that default to your setting. E.g. if your prefix is phpbb2 change it to phpbb2_vote_results.
Next: pm.
Next: wordlist.
Next: end.
And that’s it (hopefully). How far all that is working with an update to phpBB 3 afterwards… we will see ;)
So long.

