phpBB3 import script improvements

Over the last few days I converted an 11 year old phpBB 2 forum to Discourse, (going through phpBB 3 first). Overall I’m pleased with the result. Here’s some feedback that could be used to improve the phpbb3.rb import script (if you feel it is worth it):

  1. Disabled members - the phpBB forum a number of members who had requested that their accounts be disabled. The intention wasn’t to delete their posts, just remove the ability for them to log in (and for the forum to send them emails). In phpBB, their name still appeared next to their posts, with the word “Guest” next to it. However when moving to Discourse these posts were assigned to the “system” user with no trace of the original author’s name.

  2. Avatars and Emoticons - the forum had custom emoticons and uploaded avatars. The were copied from phpBB2 to 3, but not from 3 to Discourse.

  3. Ordered Lists - one post had a multi choice list written in plain text like this:

1. Question 1
- Answer 1.1
- Answer 1.2

2. Question 2
- Answer 2.1

However, when converted to Markdown it produced the following list, which was not quite as expected.

1. Question 1
2. Answer 1.1
3. Answer 1.2

4. Question 2
5. Answer 2.1
1 Like

I’m currently working on the phpBB importer in order to fix some problems of the importer.

Regarding point 1: Are you sure those accounts are just disabled? This sounds like anonymous users which currently are not supported by Discourse. Disabled users should currently be imported as normals users, which isn’t correct either. I’ve fixed that in the version of the importer I’m working on.

Importing of avatars should work. I’m not aware of any case where it doesn’t. Custom emoticons are currently not supported by Discourse, but I’m not sure if converting them should be done by the importer anyway. Maybe configuring a custom set of emojis in Discourse will be enough when this is implemented.

That’s a tough one. I’m not sure how this can be fixed since the Markdown parser interprets it as a list. The current parser has quite a few problems with edge case like this. I guess we’ll have to live with it.

Of these cases I think 1 and 3 are rare, but 2 should be considered. Can you provide us a sample import dataset to work with in confidence?

Poor terminology on my part. The user account was deleted, and his posts in phpBB2 continued to be listed with his name and the “Guest” status. In phpBB3 his posts still have his name next to the post, but with no “Guest” status. I just had a look at the phpbb_posts table (in the phpBB3 version of the database) and found that the post_username field contains his old username. For posts that are linked to users (who exist), this field is blank. The ID of the post is 1, which is the anonymous user.

Could you escape number+dot combinations that appear at start of a line? E.g.


This would be safer than converting the number to an ordered list item. BBCode ordered lists could still be converted to Markdown ordered lists.

That makes sense. I’m thinking about importing those anonymous users as suspended users. So, there posts would be assigned to a profile, but the user won’t be able to login. I guess, that’s the best we can do until Discourse supports anonymous users.

I can look into it when I’m fixing some of the bugs regarding the conversion of BBCode to Markdown. But, no promises here, since this is really a rare use case.

Can you tell us a little bit more about your problems with importing avatars? Did it import no avatars at all? Did you get any error messages?

Either solution sounds good. If you implement this, I would be interested in re-running the script (if it can create just those users).

No avatars were copied across. Unless there is a log that I can check, I won’t be able to answer the question about errors; I don’t recall any standing out.

Well, the users could be added by re-running the import script, but the already imported posts would still be assigned to system.

Did you configure the PHPBB_BASE_DIR variable in the import script? Then it should have copied the avatars. I’m not aware of any problems in this part of the importer.

PHPBB_BASE_DIR was set to /tmp/phpbb3 which is where I copied the phpbb3 folder to. If you can’t reproduce the problem with the backup that I provided @codinghorror I would just put it down to a configuration mistake (on my part). But it is worth investigating in case the avatars converted differently from phpBB2 or something.

Well, I have no access to that, so I’ll let the team worry about that problem. :wink:

Just a quick question: I need to migrate phpbb2 forum to discourse. I don’t have said forum (so I cannot upgrade it and thus upgrade to phpbb3), I have only the data dump. How can I migrate the data into phpbb3 and further, into Discourse?

You might need to install phpBB 2 again, then restore the backup through it’s control panel, then proceed with the upgrade to phpBB 3.

1 Like

I’m getting quite frustrated with this. :frowning: I’ve been trying to install phpbb3 for a while now, but it doesn’t seem to work.