diff --git a/script/import_scripts/phpbb3.rb b/script/import_scripts/phpbb3.rb index 639b51d7852..72378c68a6a 100644 --- a/script/import_scripts/phpbb3.rb +++ b/script/import_scripts/phpbb3.rb @@ -1,6 +1,10 @@ +# Importer for phpBB 3.0 and 3.1 +# Documentation: https://meta.discourse.org/t/importing-from-phpbb3/30810 + if ARGV.length != 1 || !File.exists?(ARGV[0]) STDERR.puts '', 'Usage of phpBB3 importer:', 'bundle exec ruby phpbb3.rb ' STDERR.puts '', "Use the settings file from #{File.expand_path('phpbb3/settings.yml', File.dirname(__FILE__))} as an example." + STDERR.puts '', 'Still having problems? Take a look at https://meta.discourse.org/t/importing-from-phpbb3/30810' exit 1 end diff --git a/script/import_scripts/phpbb3/database/database_3_0.rb b/script/import_scripts/phpbb3/database/database_3_0.rb index d4115cc38e1..35c5b15e501 100644 --- a/script/import_scripts/phpbb3/database/database_3_0.rb +++ b/script/import_scripts/phpbb3/database/database_3_0.rb @@ -52,11 +52,11 @@ module ImportScripts::PhpBB3 def fetch_categories query(<<-SQL) - SELECT f.forum_id, f.parent_id, f.forum_name, f.forum_name, f.forum_desc, x.first_post_time - FROM phpbb_forums f + SELECT f.forum_id, f.parent_id, f.forum_name, f.forum_desc, x.first_post_time + FROM #{@table_prefix}_forums f LEFT OUTER JOIN ( SELECT MIN(topic_time) AS first_post_time, forum_id - FROM phpbb_topics + FROM #{@table_prefix}_topics GROUP BY forum_id ) x ON (f.forum_id = x.forum_id) WHERE f.forum_type != #{Constants::FORUM_TYPE_LINK} diff --git a/script/import_scripts/phpbb3/importers/poll_importer.rb b/script/import_scripts/phpbb3/importers/poll_importer.rb index 665aae94e1d..b3099f20c1b 100644 --- a/script/import_scripts/phpbb3/importers/poll_importer.rb +++ b/script/import_scripts/phpbb3/importers/poll_importer.rb @@ -122,7 +122,8 @@ module ImportScripts::PhpBB3 end votes << option_id - else !warned + elsif !warned + warned = true Rails.logger.warn("Topic with id #{topic_id} has invalid votes.") end end