Importing / migrating from phpBB3

Woah, thank you so much, I’m going to try that!
I’d be able to like you more than once, I’ll do it. :slight_smile:

Yes, it is site settings actually, plus some users permissions, changed usernames/emails, etc.
My import is fairly long, plus I had to do some custom commands in order to remove old bb tags (size and color), bulk move thousands of topics from categories to anothers and update the counts, etc…

1 Like

Juste wondering about something. Does that mean that i’ll have about 5000 topics deleted but still in the database? What about the permalinks if I import again the topics with the same names?

Yes. They’ll be there. Yes, you’ll want to similarly delete the permalinks.

You could also delete the topics and posts from the rails console. If you want to delete all of them you could use a similar command. I’m not sure what other tables you might need to clean out.

1 Like

I might give a try as it’s the simplest solution. Hoping that won’t break things…

1 Like

Uh… I noticed something weird. My backups were about 300 MB before and I noticed that they are now more than 600 MB each.

I’m starting wondering if I didn’t remove some message through rails command a while ago and re-import them again or something like. I don’t remember doing such a thing, but I see no reason to have my backup size doubled… Is there any way to check the total number of messages (including deleted ones)? So I could compare with my phpbb forum number of messages.

edit: nevermind, I used data-explorer and I didn’t see any weird thing. Maybe it was because I had issues with imported images and I had to make a recovery from tombstone, which bringed back a lot of images (currently 300 MB of attached files).

See also The proper way to completely delete hundred of topics via rails?

Yeah I’ve created this topic to not be too off topic here.

1 Like

Hi, I have another idea.

I guess that import_id is equal to the phpbb post id?
Since I merged topics from category A and B in category C,

I could:

  1. Store all the phpbb topics id from topics that belong to my categories A and B in a json file, then
  2. Iterate the json, get the corresponding discourse topic on each iteration
  3. Update the discourse topic by changing their category from C to A or B (maybe via /topics/bulk) in each iteration

Would that do the trick on the paper?

edit : I post here since my message mentions a custom_field relative to the phpbb import, I hope I’m not too much off topic!

That part is definitely correct!

Something like your idea could definitely work if you have a mapping of the PHPbb post ID with the category you want.

Yeah, this is pretty far afield from anything to do with phpBB. :slight_smile:
@codinghorror will probably want to split this off into its own topic.

1 Like

Thank you, I’m going to work on this one.
And sorry about the off topic!

Edit : my script worked well, so here’s how I did, in case it would interest some people who’d like to “unmerge” a category after reorganizing their phpbb topics into Discourse:

  1. Installed Data Explorer Plugin
  2. Get the Discourse imported posts from the category of your choice with this query and download the result as a json:
SELECT as d_topic_id,
value as phpbb_topic_id
FROM topics
JOIN topic_custom_fields
ON topic_id =
AND name = 'import_topic_id'
AND category_id = 5

3.Get the phpbb topic list from the category(ies) of your choice from phpmyadmin and export the result as a json:

SELECT topic_id FROM phpbb_topics
JOIN phpbb_forums
ON phpbb_topics.forum_id = phpbb_forums.forum_id
AND phpbb_forums.forum_id = 20

Then you can loop iterate one of your json, and on each iteration if phpbb_topic_id is also present in the second array, then you can move it to a new category of your choice.
To do so I used and added a method to update the category of a topic.

1 Like

Any update on phpbb 3.2 support? There are thousands of phpbb forums out there and we’d love to move to Discourse if we can save the community. We have 2000 users and tired of looking like it is 2002. PHPBB is a huge pile of old outdated forum principles, extensions that are obsolete and not supported, sprinkle it with a lot of pain in the UI, etc. Everytime we go into the admin control panel, God kills a cat. And the only thing that is stopping us from moving over to something better is exporting all the existing content.

I’d love to work on it but I have no experience in Ruby and database.

1 Like

If you can at least partially sponsor the work we can take it on.

1 Like

Have you got a budget? If not, is your community interested in chief sourcing?

Hi, quick question.

After I’ve imported my phpbb topics, the messages containing a youtube link don’t embed the video.
It appears that they uses the following syntax:

How can I batch convert all these links to embed videos? The links which are not on a single line shouldn’t be embedded also, obviously.


also wanting to convert from phpbb3.2 to discourse

had a look at my DB, post_text still has HTML format (with t, br, i … tags - no idea what t is ?). Also re-ran reparser:reparse multiple time, but nothing changed in the DB. Does somebody have an example of the xml format ?

also could the few devs here give an order of magnitude for the costs for developing a phpbb3.2 converter ? 1k? 5k ? Maybe we could try to get the money together through some kind of kickstarter ?

finally : should we continue (technical) discussion here or start a new thread ?

1 Like

If you check out Discourse Migration – Literate Computing, LLC you can get some idea what a migration would cost.

Since Gerhard is apparently part-way through his work, it rather complicates giving you a good price since there are many unknowns (I dont’ know about your data or the code the Gerhard hasn’t produced).

If you contact me directly with answers the questions on my above link I could start to give you a ballpark figure if I knew more about your situation. Knowing what I know now, would say that somewhere between $1000 and $5K is probably right. :wink:

@gerhard is there anything we can do to help? I have a 3.2 community that’s just aching to be moved to Discourse. I’d love to contribute if I can in any way.


1 Like

Did the phpbb 3.2 importer ever get released ?

1 Like

ho, I got this error at this step

/var/discourse/launcher enter import # inside the Docker container

/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:inconnect’: Access denied for user ‘phpbb’@‘localhost’ (using password: YES) ( Mysql2::Error::ConnectionError )`

my mysql server is running and accessible from the outside (I can connect from my desktop computer)
any idea ?

localhost inside the Docker container is different from localhost on your desktop. You should configure the database host inside settings.yml accordingly if you want to use a remote database. Either use the MySQL server’s IP address or it’s hostname if it can be resolved via DNS.