# phpBB3 import script improvements

**URL:** https://meta.discourse.org/t/phpbb3-import-script-improvements/22935
**Category:** Migration
**Tags:** phpbb
**Created:** [December 7, 2014, 8:15pm UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935 "2014-12-07T20:15:08Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![chrisalley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisalley/32/119703_2.png) [@chrisalley](https://meta.discourse.org/u/chrisalley)
#### Post date: [December 7, 2014, 8:15pm UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/1 "2014-12-07T20:15:08Z")

</div>

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:

```plaintext
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.

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

4. Question 2
5. Answer 2.1

```

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [December 7, 2014, 10:01pm UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/2 "2014-12-07T22:01:31Z")

</div>

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.

> [@chrisalley](#):
>
> Avatars and Emoticons - the forum had custom emoticons and uploaded avatars. The were copied from phpBB2 to 3, but not from 3 to Discourse.

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.

> [@chrisalley](#):
>
> Ordered Lists - one post had a multi choice list written in plain text like this:

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 8, 2014, 12:52am UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/3 "2014-12-08T00:52:36Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![chrisalley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisalley/32/119703_2.png) [@chrisalley](https://meta.discourse.org/u/chrisalley)
#### Post date: [December 8, 2014, 12:12pm UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/4 "2014-12-08T12:12:32Z")

</div>

> [@gerhard](#):
>
> 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.

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.

> [@gerhard](#):
>
> 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.

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

`1\.`

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

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [December 8, 2014, 12:38pm UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/5 "2014-12-08T12:38:47Z")

</div>

> [@chrisalley](#):
>
> 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.

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.

> [@chrisalley](#):
>
> Could you escape number+dot combinations that appear at start of a line?

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?

---

<div class="post-metadata">

### Author: ![chrisalley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisalley/32/119703_2.png) [@chrisalley](https://meta.discourse.org/u/chrisalley)
#### Post date: [December 10, 2014, 9:23am UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/6 "2014-12-10T09:23:04Z")

</div>

> [@gerhard](#):
>
> 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.

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

> [@gerhard](#):
>
> 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?

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.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [December 10, 2014, 9:41am UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/7 "2014-12-10T09:41:15Z")

</div>

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

> [@chrisalley](#):
>
> No avatars were copied across.

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.

---

<div class="post-metadata">

### Author: ![chrisalley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisalley/32/119703_2.png) [@chrisalley](https://meta.discourse.org/u/chrisalley)
#### Post date: [December 10, 2014, 11:06am UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/8 "2014-12-10T11:06:29Z")

</div>

> [@gerhard](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [December 10, 2014, 11:22am UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/9 "2014-12-10T11:22:18Z")

</div>

> [@chrisalley](#):
>
> If you can’t reproduce the problem with the backup that I provided @codinghorror

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

---

<div class="post-metadata">

### Author: ![Silvanus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/silvanus/32/62831_2.png) [@Silvanus](https://meta.discourse.org/u/Silvanus)
#### Post date: [July 19, 2017, 1:14pm UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/10 "2017-07-19T13:14:31Z")

</div>

> [@chrisalley](#):
>
> 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.

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?

---

<div class="post-metadata">

### Author: ![chrisalley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisalley/32/119703_2.png) [@chrisalley](https://meta.discourse.org/u/chrisalley)
#### Post date: [July 19, 2017, 1:33pm UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/11 "2017-07-19T13:33:14Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Silvanus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/silvanus/32/62831_2.png) [@Silvanus](https://meta.discourse.org/u/Silvanus)
#### Post date: [July 19, 2017, 2:15pm UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/12 "2017-07-19T14:15:56Z")

</div>

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

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [December 4, 2025, 11:33am UTC](https://meta.discourse.org/t/phpbb3-import-script-improvements/22935/13 "2025-12-04T11:33:24Z")

</div>


