MyBB import script error

Hi there,

Currently I’m trying to migrate my forum from MyBB to Discourse. So far without success, despite having read several topics about it.

This is what I have done so far at my latest attempt:

  • Downloaded the database from MyBB (mybb.sql), uploaded it to the Discourse server
  • Created a database named mybb in mysql and then put mybb.sql into it

Then, following the steps mentioned here:

  • cd /var/discourse
  • ./launcher enter app
  • su - discourse
  • gem install mysql2
  • cd /var/www/discourse/script/import_scripts
  • nano mybb.rb and put the details of the mybb details into it
  • ruby mybb.rb

But during this last step, I’m currently stuck at this error:

discourse@debian94-app:/var/www/discourse/script/import_scripts$ ruby mybb.rb                                                                                                   Traceback (most recent call last):                                                                                                                                                      18: from mybb.rb:4:in `<main>'                                                                                                                                                  17: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'                                                                                16: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'                                                                                15: from /var/www/discourse/script/import_scripts/base.rb:16:in `<top (required)>'                                                                                              14: from /var/www/discourse/script/import_scripts/base.rb:16:in `require_relative'                                                                                              13: from /var/www/discourse/config/environment.rb:4:in `<top (required)>'                                                                                                       12: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'                                                                                11: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'                                                                                10: from /var/www/discourse/config/application.rb:54:in `<top (required)>'                                                                                                       9: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'                                              8: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'                                      7: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'                                     6: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'                                 5: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'               4: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'                                  3: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'                                                                                                                                                                                      2: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'                                 1: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/compile_cache/iseq.rb:38:in `load_iseq'                                           /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/compile_cache/iseq.rb:38:in `fetch': Permission denied - bs_fetch:atomic_write_cache_file:open (Errno::EACCES)                                                                                                                                                                             19: from mybb.rb:4:in `<main>'                                                                                                                                                  18: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'                                                                                17: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'                                                                                16: from /var/www/discourse/script/import_scripts/base.rb:16:in `<top (required)>'                                                                                              15: from /var/www/discourse/script/import_scripts/base.rb:16:in `require_relative'                                                                                              14: from /var/www/discourse/config/environment.rb:4:in `<top (required)>'                                                                                                       13: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'                                                                                12: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'                                                                                11: from /var/www/discourse/config/application.rb:54:in `<top (required)>'                                                                                                      10: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'                                              9: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'                                      8: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'                                     7: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'                                 6: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'               5: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'                                  4: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'                                                                                                                                                                                      3: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'                                 2: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/compile_cache/iseq.rb:34:in `load_iseq'                                                    1: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/compile_cache/iseq.rb:44:in `rescue in load_iseq'                                 /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/compile_cache.rb:29:in **`permission_error': bootsnap doesn't have permission to write cache entries in 'tmp/cache/bootsnap-compile-cache' (or, less likely, doesn't have permission to read '/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/pry-rails-0.3.9/lib/pry-rails.rb') (Bootsnap::CompileCache::PermissionError)**

I have already tried this:

  • Change the user back to root
  • chmod -R 777 tmp/cache/bootsnap-compile-cache
  • chmod -R 777 /var/www/discourse/vendor/bundle/ruby/2.6.0/gems
  • Then changing the user back to discourse with su - discourse

But that didn’t help. Does anyone know how to solve this?

1 Like