Migrate a phpBB3 forum to Discourse

Hi, I’m getting the following Traceback when running the import script, seems one of the categories already exists (even though I’m importing into a fresh install). How can I tell which category is causing the problem?

creating categories
       52 / 60 ( 86.7%)  [500 items/min]  Traceback (most recent call last):
	24: from script/import_scripts/phpbb3.rb:11:in `<main>'
	23: from script/import_scripts/phpbb3.rb:12:in `<module:ImportScripts>'
	22: from script/import_scripts/phpbb3.rb:31:in `<module:PhpBB3>'
	21: from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:20:in `perform'
	20: from /var/www/discourse/script/import_scripts/base.rb:47:in `perform'
	19: from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:30:in `execute'
	18: from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:101:in `import_categories'
	17: from /var/www/discourse/script/import_scripts/base.rb:413:in `create_categories'
	16: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:8:in `each'
	15: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:8:in `each'
	14: from /var/www/discourse/script/import_scripts/base.rb:432:in `block in create_categories'
	13: from /var/www/discourse/script/import_scripts/base.rb:461:in `create_category'
	12: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/suppressor.rb:48:in `save!'
	11: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:315:in `save!'
	10: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:383:in `with_transaction_returning_status'
	 9: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:212:in `transaction'
	 8: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `transaction'
	 7: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:227:in `within_new_transaction'
	 6: from /usr/local/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
	 5: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:230:in `block in within_new_transaction'
	 4: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `block in transaction'
	 3: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:386:in `block in with_transaction_returning_status'
	 2: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:315:in `block in save!'
	 1: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/validations.rb:52:in `save!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/validations.rb:80:in `raise_validation_error': Validation failed: Category Name has already been taken (ActiveRecord::RecordInvalid)

Thanks

Look at the standard categories, staff, is a good guess, and see where the overlap is. I sometimes add code to add the category id to the category name if it exists already.

Or you could add a put statement in the category creator to print the category name before its created.

1 Like

Edit: Just to update, I managed to deduce which forum/category names were causing the problem by inspecting a copy of the phpBB database in MySQL workbench and doing a COUNT from the phpbb_forums table where there was more than one occurrence in the forum_name column.

SELECT forum_name, COUNT(*) c FROM phpbb.phpbb_forums GROUP BY forum_name HAVING c > 1;

After reorganising/removing these duplicate forum names and taking another phpBB DB export, the importer script worked successfully.

Hi,

I’ve followed the tutorial, and I get an error during the import script:

root@kxkm-dev-import:/var/www/discourse# import_phpbb3.sh
The phpBB3 import is starting...

Loading existing groups...
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...

importing from phpBB 3.1.10

creating users
Traceback (most recent call last):
        18: from script/import_scripts/phpbb3.rb:11:in `<main>'
        17: from script/import_scripts/phpbb3.rb:12:in `<module:ImportScripts>'
        16: from script/import_scripts/phpbb3.rb:31:in `<module:PhpBB3>'
        15: from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:20:in `perform'
        14: from /var/www/discourse/script/import_scripts/base.rb:47:in `perform'
        13: from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:28:in `execute'
        12: from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:66:in `import_users'
        11: from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:168:in `batches'
        10: from /var/www/discourse/script/import_scripts/base.rb:877:in `batches'
         9: from /var/www/discourse/script/import_scripts/base.rb:877:in `loop'
         8: from /var/www/discourse/script/import_scripts/base.rb:878:in `block in batches'
         7: from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:67:in `block in import_users'
         6: from /var/www/discourse/script/import_scripts/phpbb3/database/database_3_1.rb:7:in `fetch_users'
         5: from /var/www/discourse/script/import_scripts/phpbb3/database/database_base.rb:16:in `query'
         4: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:22:in `query'
         3: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:130:in `query'
         2: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:130:in `handle_interrupt'
         1: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:131:in `block in query'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:131:in `_query': Unknown column 'f.pf_phpbb_website' in 'field list' (Mysql2::Error)

Is it a problem with my phpbb SQL dump, or with the Discourse database ?

Here is my import.yml
## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
  - "templates/web.socketed.template.yml" 
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#  #- "templates/web.ssl.template.yml"
#  #- "templates/web.letsencrypt.ssl.template.yml"
  - "templates/import/phpbb3.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
#expose:
#  - "80:80"   # http
#  - "443:443" # https

params:
  db_default_text_search_config: "pg_catalog.french"

  ## Set db_shared_buffers to a max of 25% of the total memory.
  ## will be set automatically by bootstrap based on detected RAM, or you can override
  db_shared_buffers: "3072MB"

  ## can improve sorting performance, but adds memory usage per-connection
  #db_work_mem: "40MB"

  ## Which Git revision should this container use? (default: tests-passed)
  #version: tests-passed

env:
  LANG: fr_FR.UTF-8
  # DISCOURSE_DEFAULT_LOCALE: en

  ## How many concurrent web requests are supported? Depends on memory and CPU cores.
  ## will be set automatically by bootstrap based on detected CPUs, or you can override
  UNICORN_WORKERS: 4

  ## TODO: The domain name this Discourse instance will respond to
  ## Required. Discourse will not work with a bare IP number.
  DISCOURSE_HOSTNAME: cds.kxkm.net
  DISCOURSE_RELATIVE_URL_ROOT: /forum

  ## Uncomment if you want the container to be started with the same
  ## hostname (-h option) as specified above (default "$hostname-$config")
  #DOCKER_USE_HOSTNAME: true

  ## TODO: List of comma delimited emails that will be made admin and developer
  ## on initial signup example 'user1@example.com,user2@example.com'
  DISCOURSE_DEVELOPER_EMAILS: '*****@laposte.net'

  ## TODO: The SMTP mail server used to validate new accounts and send notifications
  # SMTP ADDRESS, username, and password are required
  # WARNING the char '#' in SMTP password can cause problems!
  DISCOURSE_SMTP_ADDRESS: ******
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: ******
  DISCOURSE_SMTP_PASSWORD: "*****"
  #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

  ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
  #LETSENCRYPT_ACCOUNT_EMAIL: me@example.com

  ## The CDN address for this Discourse instance (configured to pull)
  ## see https://meta.discourse.org/t/14857 for details
  #DISCOURSE_CDN_URL: //discourse-cdn.example.com

## The Docker container is stateless; all data is stored in /shared
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git

## Any custom commands to run after building
run:
    - exec: echo "Beginning of custom commands"
  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
    - exec:
        cd: $home
        cmd:
          - mkdir -p public/forum
          - cd public/forum && ln -s ../uploads && ln -s ../backups
    - replace:
       global: true
       filename: /etc/nginx/conf.d/discourse.conf
       from: proxy_pass http://discourse;
       to: |
          rewrite ^/(.*)$ /forum/$1 break;
          proxy_pass http://discourse;
    - replace:
       filename: /etc/nginx/conf.d/discourse.conf
       from: etag off;
       to: |
          etag off;
          location /forum {
             rewrite ^/forum/?(.*)$ /$1;
          }
    - replace:
         filename: /etc/nginx/conf.d/discourse.conf
         from: $proxy_add_x_forwarded_for
         to: $http_your_original_ip_header
         global: true
    - exec: echo "End of custom commands"
and my settings.yml
# This is an example settings file for the phpBB3 importer.

database:
  type: MySQL # currently only MySQL is supported
  host: localhost
  port: 3306
  username: root
  password:
  schema: phpbb
  table_prefix: phpbb_ # Change this, if your forum is using a different prefix. Usually all table names start with phpbb_
  batch_size: 1000 # Don't change this unless you know what you're doing. The default (1000) should work just fine.

import:
  # WARNING: Do not activate this option unless you know what you are doing.
  # It will probably break the BBCode to Markdown conversion and slows down your import.
  use_bbcode_to_md: false

  # This is the path to the root directory of your current phpBB installation (or a copy of it).
  # The importer expects to find the /files and /images directories within the base directory.
  # You need to change this to something like /var/www/phpbb if you are not using the Docker based importer.
  # This is only needed if you want to import avatars, attachments or custom smilies.
  phpbb_base_dir: /shared/import/data

  site_prefix:
    # this is needed for rewriting internal links in posts
    original: http://trucfou.pe.hu/forum    # without http(s)://
    new: https://cds.kxkm.net/forum       # with http:// or https://

  # Enable this, if you want to redirect old forum links to the the new locations.
  permalinks:
    categories: true  # redirects   /viewforum.php?f=1            to  /c/category-name
    topics: true      # redirects   /viewtopic.php?f=6&t=43       to  /t/topic-name/81
    posts: true       # redirects   /viewtopic.php?p=2455#p2455   to  /t/topic-name/81/4

  avatars:
    uploaded: true  # import uploaded avatars
    gallery: true   # import the predefined avatars phpBB offers
    remote: false   # WARNING: This can considerably slow down your import. It will try to download remote avatars.

  # When true: Anonymous users are imported as suspended users. They can't login and have no email address.
  # When false: The system user will be used for all anonymous users.
  anonymous_users: false

  # Enable this, if you want import password hashes in order to use the "migratepassword" plugin.
  # This will allow users to login with their current password.
  # The plugin is available at: https://github.com/communiteq/discourse-migratepassword
  passwords: false

  # By default all the following things get imported. You can disable them by setting them to false.
  bookmarks: true
  attachments: true
  private_messages: true
  polls: true

  # When true: each imported user will have the original username from phpBB as its name
  # When false: the name of each imported user will be blank unless the username was changed during import
  username_as_name: false

  # Map Emojis to smilies used in phpBB. Most of the default smilies already have a mapping, but you can override
  # the mappings here, if you don't like some of them.
  # The mapping syntax is: emoji_name: 'smiley_in_phpbb'
  # Or map multiple smilies to one Emoji: emoji_name: ['smiley1', 'smiley2']
  emojis:
    # here are two example mappings...
    smiley: [':D', ':-D', ':grin:']
    heart: ':love:'

The table prefix should be pf_phpbb_.

3 Likes

For some reason your phpbb_profile_fields_data table doesn’t contain the pf_phpbb_website column. Either add it to the database dump or edit /var/www/discourse/script/import_scripts/phpbb3/database/database_3_1.rb inside the Docker container and replace f.pf_phpbb_website with NULL

2 Likes

It worked ! Thank you.

2 Likes

hi, is there any progress in updating script to import from phpbb 3.2?
or maybe anyone found other way to convert phpbb 3.2 to discourse, like, idk, convert to other forum and then to discourse? :joy:

I wrote a XML to Markdown converter for phpBB 3.2 and @pfaffman successfully tested it on a migration. So, I guess it’s already working quite well. It hasn’t been added to the repository yet, but that should happen this month, because I’m planning on migrating a forum with it. :slight_smile:

6 Likes

So I can make another test on migration from 3.2 :smiley:
If you want, please send me in private message converter which you mentioned. :slight_smile:

+1 for this.
I’ve a large phpbb 3.2 forum jumping at the bits to migrate across to discourse.
please let me know when this XML Markdown is available

1 Like

Hi,

It that converter publicly available? I would like to test a migration, specially my own forum in which I have custom BBCodes (from my own phpBB extensions).

1 Like

Yes, it’s available. You can follow my work at https://github.com/gschlager/discourse/tree/phpbb3.

I assume you will be able to figure this out on your own, since you want to add support for custom BBCodes. I won’t give any support until my work is finished and merged. Expect some heavy refactoring on my part which might break things for you. :wink:

Two hints to get you started:

The import from phpBB 3.2 works with a few caveats right now:

  • Poll votes aren’t imported.
  • Internal links aren’t rewritten to Discourse URLs.
  • The [attachment] BBCode doesn’t work.
11 Likes

Thanks for your effort mate, I’m really looking forward to trying this once it’s merged.

Unfortunately I didn’t have much luck getting my docker container to use your fork, although that’s simply my lack of knowledge of docker and GitHub.

You might just copy the files by hand inside the container. You could stick them in uploads, for example, and then copy them into place with cp.

thanks. After a few tries I got it working by copying the script files to the container then running the import script.

960,000 post forum and I paused it at 350,000 posts.
My tests so far have shown the import to be successful, everything looks good.
It does take a long time to import posts, I’m running at 600 posts per minute which isn’t ideal. But I shouldn’t complain!

One thing I encountered is that when you include “templates/import/phpbb3.template.yml” and rebuild, the discourse instance can’t be browsed to. I don’t know if this is by design? I’m still able to enter the container and run the import, then I simply remove the reference to the the template and rebuild.

1 Like

It is. It’s done that way to devote all resources to doing the import!

2 Likes

so i started to run into issues importing posts that were created after the initial upgrade from 3.1 to 3.2 a couple of years ago.

There was an issue with https://github.com/gschlager/discourse/tree/phpbb3/script/import_scripts/phpbb3/support)text_processor.rb
On line 26:

username_from_user_id: lambda { |user_id| @lookup.find_username_by_import_id(user_id) },

I think it needs to be:
username_from_user_id: lambda { |user_id| @lookup.find_user_by_import_id(user_id) },

I changed it and go these errors:

Too many open files
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mini_racer-0.2.3/lib/mini_racer.rb:269:in `pipe'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mini_racer-0.2.3/lib/mini_racer.rb:269:in `timeout'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mini_racer-0.2.3/lib/mini_racer.rb:178:in `block in eval'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mini_racer-0.2.3/lib/mini_racer.rb:176:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mini_racer-0.2.3/lib/mini_racer.rb:176:in `eval'
/var/www/discourse/lib/pretty_text.rb:181:in `block in markdown'
/var/www/discourse/lib/pretty_text.rb:408:in `block in protect'
/var/www/discourse/lib/pretty_text.rb:407:in `synchronize'
/var/www/discourse/lib/pretty_text.rb:407:in `protect'
/var/www/discourse/lib/pretty_text.rb:142:in `markdown'
/var/www/discourse/lib/pretty_text.rb:249:in `cook'
/var/www/discourse/plugins/poll/plugin.rb:274:in `extract'
/var/www/discourse/plugins/poll/lib/polls_validator.rb:13:in `validate_polls'
/var/www/discourse/plugins/poll/plugin.rb:383:in `block (2 levels) in activate!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:426:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:179:in `block (2 levels) in halting_and_conditional'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:606:in `block (2 levels) in default_terminator'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:605:in `catch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:605:in `block in default_terminator'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:180:in `block in halting_and_conditional'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:513:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:513:in `invoke_before'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:131:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:816:in `_run_validate_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.2/lib/active_model/validations.rb:409:in `run_validations!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.2/lib/active_model/validations/callbacks.rb:118:in `block in run_validations!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:132:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:816:in `_run_validation_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.2/lib/active_model/validations/callbacks.rb:118:in `run_validations!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.2/lib/active_model/validations.rb:339:in `valid?'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/validations.rb:67:in `valid?'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/validations.rb:84:in `perform_validations'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/validations.rb:46:in `save'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:310:in `block (2 levels) in save'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:387:in `block in with_transaction_returning_status'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:257:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:212:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:385:in `with_transaction_returning_status'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:310:in `block in save'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:325:in `rollback_active_record_state!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:309:in `save'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/suppressor.rb:44:in `save'
/var/www/discourse/lib/post_creator.rb:479:in `save_post'
/var/www/discourse/lib/post_creator.rb:168:in `block in create'
/var/www/discourse/lib/post_creator.rb:335:in `block (2 levels) in transaction'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:259:in `block in transaction'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/usr/local/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:259:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:212:in `transaction'
/var/www/discourse/lib/post_creator.rb:334:in `block in transaction'
/var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:5:in `synchronize'
/var/www/discourse/lib/post_creator.rb:333:in `transaction'
/var/www/discourse/lib/post_creator.rb:165:in `create'
/var/www/discourse/script/import_scripts/base.rb:566:in `create_post'
/var/www/discourse/script/import_scripts/base.rb:514:in `block in create_posts'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.1/lib/patches/db/mysql2.rb:8:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.1/lib/patches/db/mysql2.rb:8:in `each'
/var/www/discourse/script/import_scripts/base.rb:501:in `create_posts'
/var/www/discourse/script/import_scripts/phpbb3/importer.rb:118:in `block in import_posts'
/var/www/discourse/script/import_scripts/base.rb:898:in `block in batches'
/var/www/discourse/script/import_scripts/base.rb:897:in `loop'
/var/www/discourse/script/import_scripts/base.rb:897:in `batches'
/var/www/discourse/script/import_scripts/phpbb3/importer.rb:168:in `batches'
/var/www/discourse/script/import_scripts/phpbb3/importer.rb:112:in `import_posts'
/var/www/discourse/script/import_scripts/phpbb3/importer.rb:31:in `execute'
/var/www/discourse/script/import_scripts/base.rb:47:in `perform'
/var/www/discourse/script/import_scripts/phpbb3/importer.rb:20:in `perform'
script/import_scripts/phpbb3.rb:31:in `<module:PhpBB3>'
script/import_scripts/phpbb3.rb:12:in `<module:ImportScripts>'
script/import_scripts/phpbb3.rb:11:in `<main>'
   761543 / 984659 ( 77.3%)  [43803 items/min]  Exception while creating post 786261. Skipping.

I’m quite sure that this is correct and shouldn’t be changed.

5 Likes

I hadn’t copied the whole import_scripts folder, that’s why I ran into issues.

Anyway, my forum has migrated successfully and it’s looking stunning.

2 Likes