Migrate a phpBB3 forum to Discourse

Is there any way around this? A lot of forums have users who signed up with email addresses they no longer have access to and they are using passwords with less than 10 characters.

1 Like

You can change the minimum password length to 8 in site settings.

People who canā€™t use their password can have a login link or password reset link sent to them.

2 Likes

Yes, there is a site setting migratepassword allow insecure passwords, just enable it.

Make sure to enable this AFTER the import, not during the import.

4 Likes

5 posts were split to a new topic: Accent characters missing

rank_mapping:
   trust_level_1: 200
   trust_level_2: 1000
   trust_level_3: 3000

How does this work excactly? Do I need to create custom ranks in phpBB (where I can only set a different number of total posts as criteria) or does the importer check every user for the total number of posts and assigns the trust level in Discourse according to that?

Thank you! :slight_smile:

1 Like
# Rank to trust level mapping
  #
  # Map phpBB 3.x rank levels to trust level
  # Users with rank at least 3000 will have TL3, etc.
      trust_level = @settings.trust_level_for_posts(row[:user_posts], trust_level: trust_level)

So itā€™s just mapping the number of posts they have created to various trust levels. My inclination would be to set everyone at TL1 and let them go through the Discourse levels from there; itā€™s not that hard to get to TL2.

But at some point someone who was migrating to Discourse thought it was important to tweak the trust levels for their users and the programmer thought it was easier to code it than to argue with them. :slight_smile:

4 Likes

Yes you are right. I would also prefer that. I just wanted to make sure that I understood the feature correctly. :slight_smile:

3 Likes

Will not install ruby-bbcode-to-md, as if IMPORT=1 invalid.

mike@ubuntu:~/discourse/script/import_scripts$ IMPORT=1 bundle exec ruby phpbb3.rb phpbb3/settings.yml
Traceback (most recent call last):
	40: from phpbb3.rb:13:in `<main>'
	39: from phpbb3.rb:14:in `<module:ImportScripts>'
	38: from phpbb3.rb:15:in `<module:PhpBB3>'
	37: from phpbb3.rb:15:in `require_relative'
	36: from /home/mike/discourse/script/import_scripts/phpbb3/support/settings.rb:5:in `<top (required)>'
	35: from /home/mike/discourse/script/import_scripts/phpbb3/support/settings.rb:5:in `require_relative'
	34: from /home/mike/discourse/script/import_scripts/base.rb:16:in `<top (required)>'
	33: from /home/mike/discourse/script/import_scripts/base.rb:16:in `require_relative'
	32: from /home/mike/discourse/config/environment.rb:7:in `<top (required)>'
	31: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/application.rb:372:in `initialize!'
	30: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:60:in `run_initializers'
	29: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
	28: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
	27: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
	26: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:347:in `call'
	25: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:347:in `each'
	24: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
	23: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
	22: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	21: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
	20: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:61:in `block in run_initializers'
	19: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:32:in `run'
	18: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:32:in `instance_exec'
	17: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/application/finisher.rb:68:in `block in <module:Finisher>'
	16: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/reloader.rb:88:in `prepare!'
	15: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:106:in `run_callbacks'
	14: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:595:in `invoke_before'
	13: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:595:in `each'
	12: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:595:in `block in invoke_before'
	11: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:200:in `block in halting'
	10: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:686:in `block in default_terminator'
	 9: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:686:in `catch'
	 8: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:687:in `block (2 levels) in default_terminator'
	 7: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:199:in `block (2 levels) in halting'
	 6: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:445:in `block in make_lambda'
	 5: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:445:in `instance_exec'
	 4: from /home/mike/discourse/config/initializers/002-freedom_patches.rb:9:in `block in <main>'
	 3: from /home/mike/discourse/config/initializers/002-freedom_patches.rb:9:in `each'
	 2: from /home/mike/discourse/config/initializers/002-freedom_patches.rb:11:in `block (2 levels) in <main>'
	 1: from /home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:31:in `require'
/home/mike/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/callbacks.rb:25:in `on_file_autoloaded': expected file /home/mike/discourse/lib/freedom_patches/copy_file.rb to define constant FreedomPatches::CopyFile, but didn't (Zeitwerk::NameError)

Just doing a shameless bumpā€¦ Because Iā€™ll have to do two new phpBB migrations soon (advocating for Discourse as much as I can :partying_face:). There is no rush at all.
The migrations could even wait for a few months or a bit more but if you have any news about this info, that would be nice :slight_smile:

2 Likes

Well, 2022 was optimisticā€¦ :blush: Other tasks got bumped in front of my todo list, but things are clearing up, so something will happen in 2023. And hopefully sooner than later. :crossed_fingers:

3 Likes

I just ran a phpBB import for what I think was a 3.3 forum. It seemed to work fine (except for the Solved plugin they were using and some [tex2] tags that need to be replaced with some $$, but I expected that not to work). Unless youā€™ve got a huge forum (25K users and ~300K posts took 17 hours on not-too-fast hardware), you might just go ahead and give it a shot.

4 Likes

Sure, thanks for the info!
But Iā€™m very curious about the changes made. Iā€™d love to have a look at the code and see it at work since I donā€™t have a specific date to do my migrations :slight_smile:

1 Like

Hi, Iā€™m new here so sorry for the stupid question:

What exactly should the site_name parameter in the settings.yml file contain? I donā€™t understand what is needed here. I got this error:

The phpBB3 import is starting...

/var/www/discourse/script/import_scripts/phpbb3/support/settings.rb:49:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError)

      @site_name = import_settings["site_name"]
                                  ^^^^^^^^^^^^^
	from /var/www/discourse/script/import_scripts/phpbb3/support/settings.rb:11:in `new'
	from /var/www/discourse/script/import_scripts/phpbb3/support/settings.rb:11:in `load'
	from script/import_scripts/phpbb3.rb:20:in `<module:PhpBB3>'
	from script/import_scripts/phpbb3.rb:16:in `<module:ImportScripts>'
	from script/import_scripts/phpbb3.rb:15:in `<main>'

Iā€™m trying to import just one forum (phpBB version 3.3.8). When I leave it blank or type something like ā€˜firstā€™ or ā€˜domain.comā€™ etc, I still get this error.
Thank you for your help and patience.

Set it to anything. Even an empty string.

Then youā€™re somehow setting in the wrong place or there is a typo, I would guess.

2 Likes

Thank you for your response. I recreated the settings.yml from scratch, copied the raw code from github and now it works like a charm :+1:

2 Likes

20 posts were split to a new topic: Migrating from phpbb (installed version history: 3.2.1 - 3.2.8) with a postgresql db

That turned out not to be true. Is the plan to re-tool them all into bulk_import-style scripts? Do you have a new estimate of what that timeline might look like?

3 Likes

Yes, thatā€™s more or less the plan. Unfortunately I canā€™t say when it will be released as itā€™s not the highest priority right now, but we plan to improve imports in the next 6-12 months. My hope is that there will be something usable by that time.

3 Likes

PR for another simple improvement. phpbb attachments have a text comment that is displayed below the attachment in a post.

i added support for that. it adds the comment in italics below the image in discourse.

4 Likes