Migrate a phpBB3 forum to Discourse

Hey, @allu, are you doing a phpBB3 3.2 import?

@funtent and @MJ94: The Blender community did a kickstarter to raise funds to pay for an import as well as significant improvements to the Vbulletin importer.

Perhaps one or both of your communities could do the same.

7 Likes

Luckily not :grinning: The migration I am working on is a old clunky phpBB 3.0.X. Am currently analyzing which bbcode use cases I have in the data, how many of each, and doing some sample visual checks to see if any conversion issues remain. Btw, using this approach to find posts containing a specific bbcode as candidates for my checks (in mysql, for example):

select * from phbb_posts where post_text REGEXP "\\[size=.*\\]"

Found this quite helpful for finding the needle(s) in the haystack :wink:

2 Likes

Hello everyone. We are currently running phpBB 3.2 - Iā€™d love to know how I can help writing the XML to Markdown conversion script.

1 Like

The code is there. Youā€™d want to use Nokogiri to help with the transition. There may be other xml to markdown tools.

2 Likes

Hi,
I imported a forum but it seems to be an issue regarding the number of topics in the category list:
image

And if I go to GƩnƩral:

There are hundreds of topics on each category.

However, the number of topics is displated right on the category page:

2 Likes

How long ago have you done the import? These stats are updated in a background job that runs every day/week (canā€™t remember).

5 Likes

Hi,
The import ended at least 6 hours ago. I looked at the sidekiq josb but I couldnā€™t find anything related to this. There was something like Category stats but it didnā€™t change anything after it was done.

If itā€™s updated in a short future any way, thatā€™s not a big deal. Thanks for your reply. :slight_smile:

1 Like

I think this number only take the number of topics in this specific category and doesnā€™t count all subcategories.

I donā€™t know if itā€™s a bug or not though

4 Likes

Yeah, I got it. In phpbb you could have categories in which you canā€™t post messages, they just act as parents for subcategories.
So there is no message in them.

The displayed number for a category only shows posts that are posted in this category but not those posted in a subcategory as you said. Seems weird though.

Another question since Iā€™m here: what happens if I import my phpbb data twice? Does it skip already imported messages/users/passwords/attachments?

1 Like

Yes. It skips already imported users and posts.

6 Likes

Hi!

Still here. :smiley: I noticed that my imported images arenā€™t displayed (404 error) though I imported them in the import settings.
Any idea how does that come from and if it is possible to fix the issue without having to re-import?

I also reorganized all my categories and moved messages to other categoriesā€¦ Iā€™d prefer not to do all of this again, I hope there is a solution.

edit: I discovered rake uploads:recover_from_tombstone. Hope that will help.
edit2: that helps.

1 Like

That issue being solved, I have another question.
I imported from a fairly old phpbb dump ; December 2017. I did not notice until I made a lot of configuration and reorganization on my Discourse.
I can get a recent dump of my phpbb, what would be the proper way to add only the new (from December 2017 until now) messages, uploads and users to my Discourse?

I got that the importer will ignore the existing users categories and stuff but will it identify existing messages if I changed their categories on Discourse?

Also, on the last import I tried, I got the message after starting phpbb3_import.rb:

Table `phpbb.phpbb3_config` doesn't exist

I had my dump named phpbb_mysql.sql inside /var/discourse/shared/standalone/import/data and I edited settings.yml :

table_prefix: phpbb3_ 

as it is the prefix on my dump tables:

CREATE TABLE `phpbb3_config`

Any idea?

1 Like

Iā€™m not sure why it doesnā€™t find the phpbb3_config table. Thereā€™s probably something wrong with your database dump.

The importer supports incremental imports. Simply put the new phpbb_mysql.sql and attachments into /var/discourse/shared/standalone/import/data restart the import. The importer uses the original IDs from phpBB3 to identify already imported data, so thereā€™s no need to worry.

Anyway, itā€™s probably a good idea to create a backup in Discourse before you start the next import. Just in caseā€¦ :wink:

6 Likes

Thanks for your reply. My dump seems fine but I do notice some differences between the two dumps.
Hereā€™s a comparison of the first lines: https://www.diffchecker.com/ITAyzGCD (new one on left)

1 Like

Try removing

CREATE DATABASE IF NOT EXISTS `monocycleinfo_forum` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `monocycleinfo_forum`;
5 Likes

Worked like a charm, thanks!

3 Likes

Hey all, every time I run step 1.5 Executing the import script

I receive the following error in the terminal:

Error response from daemon: Container [id] is not running

Iā€™m not clear on how to get the container running? Any advise would be greatly appreciated :pray:

1 Like

You should reinstall or restart docker, itā€™s not coming from Discourse

It is service docker restart for the second one I think

2 Likes

Thanks @Steven if I stop the discourse/app I can then enter import but of course the import fails because Discourse isnā€™t running. If I run docker ps -a this is what I see:

CONTAINER ID        IMAGE                    COMMAND             CREATED             STATUS                      PORTS                                      NAMES
0e44d0c41023        local_discourse/import   "/sbin/boot"        24 minutes ago      Exited (5) 17 minutes ago                                              import
de1aa6a0e624        local_discourse/app      "/sbin/boot"        24 hours ago        Up 17 minutes               0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   app`

So if I run docker stop de1aa6a0e624 I can then run /var/discourse/launcher enter import and it starts the import but as I said, of course fails.

Port 443 seems to be the issue, if I try to start the container [id] I posted above I see: Bind for 0.0.0.0:443 failed: port is already allocated

1 Like

I guess for some reason the import container wasnā€™t running when you tried to enter it the first time. Try the following steps:

/var/discourse/launcher stop app
/var/discourse/launcher start import
/var/discourse/launcher enter import

And if that doesnā€™t work, try

/var/discourse/launcher stop app
/var/discourse/launcher rebuild import
/var/discourse/launcher enter import
7 Likes