Migrating from mybb


(Dan Dascalescu) #1

I’m trying to migrate a MyBB instance and haven’t found a walk-through, so hopefully this can become one.

I’m also new to Rails and Docker.

So far I’ve installed the Discourse Docker image, launched a local MySQL server and populated it with the data from MyBB.

The migration script only says it should be called like this:

RAILS_ENV=production bundle exec ruby script/import_scripts/mybb.rb

That assumes you have cloned the discourse repo itself (not the Docker). So you have to first

mkdir /var/discourse.src
git clone https://github.com/discourse/discourse.git /var/discourse.src
cd /var/discourse.src

You also need to run

apt-get install bundler

After that, I’m out of my depth. bundle install says “You are running an old version of bundler, please update by running: gem install bundler” but after I run gem install bundler (which gets bundler-1.8.2) and re-run bundle install, I get the same warning.

Anyway, the blocker is

Gem::InstallError: better_errors requires Ruby version >= 2.0.0.

Do I just go ahead and install Ruby 2.1.5? How do I do that inside the Docker container? Is Discourse compatible with Ruby 2? If so, should the Docker image be updated?

I gave a try to installing Ruby 2.1.5, but I still get the error about Ruby >= 2.0.0. being required:

root@...:/var/discosrc# RAILS_ENV=production bundle exec ruby script/import_scripts/mybb.rb
Could not find rake-10.4.2 in any of the sources
Run `bundle install` to install missing gems.
root@...:/var/discosrc# bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Fetching gem metadata from https://rubygems.org/.......
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.4.2
Using 6to5-source 3.3.7
Using execjs 2.2.2
Using 6to5 0.5.0
Using CFPropertyList 2.2.8
Using i18n 0.6.11
Using json 1.8.2
Using minitest 5.5.1
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.1.8
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.8
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.8
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.8
Using actionpack-action_caching 1.1.1
Using activemodel 4.1.8
Using active_model_serializers 0.8.2
Using arel 5.0.1.20140414130214
Using activerecord 4.1.8
Using annotate 2.6.5
Using handlebars-source 2.0.0
Using ember-source 1.9.0.beta.4
Using barber 0.5.0
Using coderay 1.1.0

Gem::InstallError: better_errors requires Ruby version >= 2.0.0.
An error occurred while installing better_errors (2.1.1), and Bundler cannot continue.
Make sure that `gem install better_errors -v '2.1.1'` succeeds before bundling.

PS: no “migration” tag?


Install Discourse on digital ocean Will PAY $10
DiscourseHosting migration service for your existing forum
Markdown syntax for "txt" assumes another language
Install and import Mysql on the development environment
MyBB failed to import
(Jens Maier) #2

I would generally recommend to run the importer in development mode, export the result as a backup and restore that into the production instance. If that is not an option for you, try this:

  • Connect to your server, become root (if you’ve connected as a regular user) and cd /var/discourse
  • SSH into or enter the running production container: ./launcher ssh app or ./launcher enter app.
  • Become the discourse user: su - discourse
  • Install the MySQL client gem: gem install mysql2
  • Open the import script in an editor and fill in your old forum’s MySQL server address: cd /var/www/discourse/script/import_scripts && nano mybb.rb
  • (You will most likely have to change your old server’s configuration or firewall to gain access to your MySQL server; if that isn’t possible, you may have to install MySQL inside the container and import a dump of the mybb database.)
  • Run the importer: ruby mybb.rb

If everything worked, rebuild your production container to get rid of the MySQL server, gem and modifications to mybb.rb.


Mybb.rb imports nothing
Mybb.rb imports nothing
(Dan Dascalescu) #3

How can I run the importer in “development mode”?

The MyBB forum runs on a separate machine. I cloned the Discourse repo on that machine, changed the MySQL login details in mybb.rb and tried to run RAILS_ENV=production bundle exec ruby script/import_scripts/mybb.rb. It failed with:

/home/dan/discourse/Gemfile:92:in `evaluate': compile error (SyntaxError)
/home/dan/discourse/Gemfile:72: syntax error, unexpected ':', expecting kEND
  gem 'arel', git: 'https://github.com/rails/arel.git'
                  ^
/home/dan/discourse/Gemfile:73: syntax error, unexpected ':', expecting kEND
  gem 'rails', git: 'https://github.com/rails/rails.git'
                   ^
/home/dan/discourse/Gemfile:74: syntax error, unexpected ':', expecting kEND
  gem 'rails-observers', git: 'https://github.com/SamSaffro...
                             ^
/home/dan/discourse/Gemfile:75: syntax error, unexpected ':', expecting kEND
  gem 'seed-fu', git: 'https://github.com/SamSaffro...
                     ^
/home/dan/discourse/Gemfile:75: syntax error, unexpected ',', expecting kEND
...b.com/SamSaffron/seed-fu.git', branch: 'discourse'
                              ^
/home/dan/discourse/Gemfile:92: syntax error, unexpected ':', expecting $end
gem 'redis', require:  ["redis", "redis/connection/hiredis"]
                     ^
        from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:17:in `build'
        from /usr/lib/ruby/vendor_ruby/bundler.rb:136:in `definition'
        from /usr/lib/ruby/vendor_ruby/bundler.rb:124:in `load'
        from /usr/lib/ruby/vendor_ruby/bundler.rb:107:in `setup'
        from /usr/lib/ruby/vendor_ruby/bundler/cli.rb:342:in `exec'
        from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor/task.rb:22:in `send'
        from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor/task.rb:22:in `run'
        from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor.rb:246:in `dispatch'
        from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor/base.rb:389:in `start'
        from /usr/bin/bundle:13

These syntax errors suggest that bundle was the wrong executable. I ran sudo gem install bundler, which fixed the problem. Then,

RAILS_ENV=production bundle exec ruby script/import_scripts/mybb.rb
Could not find pg-0.18.1 in any of the sources
Run `bundle install` to install missing gems.

Alright,

$ bundle install
Fetching gem metadata from https://rubygems.org/.......
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Using rake 10.4.2
Using CFPropertyList 2.2.8
Using i18n 0.7.0
Using json 1.8.2
Using minitest 5.5.1
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.1.9
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.9
Using rack 1.5.2
Using rack-test 0.6.3
Using actionpack 4.1.9
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.9
Using actionpack-action_caching 1.1.1
Using activemodel 4.1.9
Using active_model_serializers 0.8.2
Using arel 5.0.1.20140414130214
Using activerecord 4.1.9
Using annotate 2.6.6
Using babel-source 4.6.6
Using execjs 2.4.0
Using babel-transpiler 0.6.0
Using handlebars-source 2.0.0
Using ember-source 1.9.0.beta.4
Using barber 0.5.0
Using coderay 1.1.0
Using better_errors 2.1.1
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.2
Using hitimes 1.2.2
Using timers 4.0.1
Using celluloid 0.16.0
Using certified 1.0.0
Using connection_pool 2.1.2
Using crass 1.0.1
Using daemons 1.1.9
Using diff-lcs 1.2.5
Using docile 1.1.5
Using dotenv 1.0.2
Using email_reply_parser 0.5.8
Using ember-data-source 0.14
Using thor 0.19.1
Using railties 4.1.9
Using jquery-rails 3.1.2
Using ember-rails 0.14.1
Using eventmachine 1.0.7
Using excon 0.44.4
Using exifr 1.1.3
Using fabrication 2.9.8
Using fakeweb 1.3.0
Using multipart-post 2.0.0
Using faraday 0.9.1
Using fast_blank 0.0.2
Using rake-compiler 0.9.4
Using fast_stack 0.1.0
Using fast_xor 1.1.3
Using fast_xs 0.8.0
Using fastimage_discourse 1.6.6
Using ffi 1.9.6
Using fission 0.5.0
Using flamegraph 0.1.0
Using formatador 0.2.5
Using net-ssh 2.9.2
Using net-scp 1.2.1
Using fog-core 1.27.2
Using mini_portile 0.6.2
Using nokogiri 1.6.6.2
Using fog-xml 0.1.1
Using fog-atmos 0.1.0
Using multi_json 1.10.1
Using fog-json 1.0.0
Using inflecto 0.0.2
Using fog-brightbox 0.7.1
Using fog-ecloud 0.0.2
Using fog-profitbricks 0.0.1
Using fog-radosgw 0.0.3
Using fog-sakuracloud 0.1.1
Using fog-softlayer 0.3.26
Using fog-storm_on_demand 0.1.0
Using fog-terremark 0.0.3
Using fog-vmfusion 0.0.1
Using fog-voxel 0.0.2
Using ipaddress 0.8.0
Using fog 1.26.0
Using foreman 0.77.0
Using fspath 2.0.6
Using sorcerer 1.0.2
Using given_core 3.5.4
Using guess_html_encoding 0.0.11
Using hashie 3.4.0
Using highline 1.7.1
Using hike 1.2.3
Using hiredis 0.6.0
Using htmlentities 4.3.3
Using image_size 1.1.5
Using in_threads 1.2.2
Using progress 3.0.2
Using image_optim 0.9.1
Using jwt 1.3.0
Using kgio 2.9.3
Using librarian 0.1.2
Using libv8 3.16.14.7
Using listen 0.7.3
Using logster 0.1.8
Using lru_redux 0.8.4
Using redis 3.2.1
Using message_bus 1.0.6
Using metaclass 0.0.4
Using method_source 0.8.2
Using mocha 1.1.0
Using mock_redis 0.14.0
Using moneta 0.8.0
Using msgpack 0.5.11
Using multi_xml 0.5.5
Using mustache 0.99.8
Using netrc 0.10.3
Using nokogumbo 1.2.0
Using oauth 0.4.7
Using oauth2 1.0.0
Using oj 2.12.0
Using omniauth 1.2.2
Using omniauth-oauth2 1.2.0
Using omniauth-facebook 2.0.0
Using omniauth-github-discourse 1.1.2
Using omniauth-google-oauth2 0.2.5
Using omniauth-oauth 1.0.1
Using ruby-openid 2.5.0
Using rack-openid 1.3.1
Using omniauth-openid 1.0.1
Using omniauth-twitter 1.0.1
Using onebox 1.5.13
Using openid-redis-store 0.0.2

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby -r ./siteconf20150312-9260-1dzgbkw.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/$(RUBY_BASE_NAME)
        --with-pg
        --without-pg
        --enable-windows-cross
        --disable-windows-cross
        --with-pg-config
        --without-pg-config
        --with-pg_config
        --without-pg_config
        --with-pg-dir
        --without-pg-dir
        --with-pg-include
        --without-pg-include=${pg-dir}/include
        --with-pg-lib
        --without-pg-lib=${pg-dir}/lib

extconf failed, exit code 1

Gem files will remain installed in /tmp/bundler20150312-9260-osxjxp/pg-0.18.1/gems/pg-0.18.1 for inspection.
Results logged to /tmp/bundler20150312-9260-osxjxp/pg-0.18.1/extensions/x86_64-linux/2.2.0-static/pg-0.18.1/gem_make.out
An error occurred while installing pg (0.18.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.1'` succeeds before bundling.

Stuck.

I also tried the second option you mentioned, but couldn’t install the mysql2 gem:

root@li895-63-app:~# su - discourse
discourse@li895-63-app:~$ gem install mysql2
Fetching: mysql2-0.3.18.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/lib/ruby/gems/2.0.0 directory.

Exited the su and tried to install it as root:

root@localhost:/var/discourse# ./launcher ssh app
WARNING: No memory limit support
WARNING: No swap limit support
lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory
lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory

Welcome to Discourse Docker


Use: rails, rake or discourse to execute commands in production

root@li895-63-app:~# gem install mysql2
Fetching: mysql2-0.3.18.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby -r ./siteconf20150312-1794-3xmznr.rb extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/ruby
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/
        --with-mysql-config
        --without-mysql-config
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mlib
        --without-mlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-zlib
        --without-zlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-socketlib
        --without-socketlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-nsllib
        --without-nsllib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mygcclib
        --without-mygcclib
        --with-mysqlclientlib
        --without-mysqlclientlib

extconf failed, exit code 1

Gem files will remain installed in /usr/local/lib/ruby/gems/2.0.0/gems/mysql2-0.3.18 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.0.0/extensions/x86_64-linux/2.0.0-static/mysql2-0.3.18/gem_make.out
root@li895-63-app:~#

Rails is known to be hard to install, and Ruby is part of that problem. This is makes the migration process quite painful and a traumatic experience for new users. How can we improve this? Are the some streamlined guidelines on importing data from other forums that I’ve missed?

This doesn’t only apply to MyBB. Running any migration script needs to get all these dependencies installed, and I’ve been running into errors after errors.


(Jens Maier) #4

No, if bundle wasn’t the right program, it wouldn’t have a known to look at the Gemfile; however, I’m guessing that there are several versions of Ruby installed on the machine and bundler was using an outdated Ruby. The shorthand hash assignment notation symbol: "value" (instead of :symbol => "value") was introduced with Ruby 1.9.

The pg gem requires the native PostgreSQL client library and its C header files. On Ubuntu, sudo apt-get install libpq-dev should install these files.

Either install the gem with sudo or install it in your user’s home directory with gem install --user-install mysql2. Newer versions of rubygems should actually do this automatically when run by a non-root user…

This time around, you were running inside Discourse’s production container. The container hosts an Ubuntu userland separate from your host machine, so packages you installed on the host - e.g. the mysql client library - aren’t available inside. Running apt-get install libmysqlclient-dev in the container should fix this.

I tend to disagree. The problem is that Ubuntu, even in the “server” flavour, is targeting ex-point&click users. Like many other binary distributions, compiling C code against libraries installed by the system package manager is impossible unless an additional -dev package is installed as well. Ruby, on the other hand, assumes that it runs on a full-featured POSIX platform where it is and always has been the custom to keep required C header files alongside installed library binaries.

Yes, that I fully agree with, but I have no ideas for an easy solution. Perhaps an alternative docker image that includes mysql dependencies?


Core dump when running the MyBB import script
(Dan Dascalescu) #5

@elberet, thanks for your help so far. I went for the second option - connecting from the Discourse machine to the MySQL server of the running forum (set to maintenance mode) after enabling port 3306 in the firewall and setting bind-address = 0.0.0.0 in /etc/mysql/my.cnf followed by a sudo service mysql restart. Here’s what I’ve done based on your advice:

cd /var/discourse
./launcher enter app
apt-get update
apt-get install libmysqlclient-dev mc -y
gem install mysql2  # mysql2-0.3.18 got installed
su - discourse
cd /var/www/discourse/script/import_scripts
bundle install
mcedit mybb.rb  # make edits to the MySQL connection details
RAILS_ENV=production ruby mybb.rb  # no idea what "bundle exec" does

To setup redirects from the old forum thread URLs to Discourse topics, see my other post:


MyBB importer script failing at creating users stage
Batch processing to search and replace in all posts
Mybb.rb imports nothing
Install and import Mysql on the development environment
Unhandled error when importing banned user
(Jens Maier) #6

Try running gem install mysql2 after su - discourse.


(Dan Dascalescu) #7

That requires sudo, so I tried with --user-install, but got the same error in the end:

root@localhost:~# cd /var/discourse

root@localhost:/var/discourse# ./launcher enter app

WARNING: No memory limit support
WARNING: No swap limit support

root@li895-63-app:/# su - discourse

discourse@li895-63-app:~$ gem install mysql2
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/lib/ruby/gems/2.0.0 directory.

discourse@li895-63-app:~$ gem install --user-install mysql2
WARNING:  You don't have /home/discourse/.gem/ruby/2.0.0/bin in your PATH,
          gem executables will not run.
Building native extensions.  This could take a while...
Successfully installed mysql2-0.3.18
1 gem installed

discourse@li895-63-app:~$ cd /var/www/discourse/script/import_scripts

discourse@li895-63-app:/var/www/discourse/script/import_scripts$ RAILS_ENV=production ruby mybb.rb
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- mysql2 (LoadError)
        from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:247:in `block in require'
        from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:232:in `load_dependency'
        from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:247:in `require'
        from mybb.rb:3:in `<main>'
discourse@li895-63-app:/var/www/discourse/script/import_scripts$

(Jens Maier) #8

Ah, I see. I think base.rb changed recently and now loads the Rails environment immediately. This also loads bundler which overrides require, and since mysql2 is not in Discourse’s bundle, it can’t be loaded.

Fixed here:
https://github.com/Elberet/discourse/commit/1cc7db23707a70889dd135c0cde32ff1850013e5

Grab the update from my fork (or just edit it into your local copy of the script – it’s three lines…) or wait until it’s merged into the core repo. :slight_smile:

CC @neil and @gerhard since the phpbb3 and, I’d assume, all other importers will likely have the same issue.


(Gerhard Schlager) #9

I’m always adding gem 'mysql2' to the Gemfile which always seems to work, so I didn’t even notice that there is a problem.
I guess I should read more about how Ruby handles its dependencies. Just to clarify, moving the require 'mysql2' to the top isn’t enough, is it? At least in my development environment I still get an error. So, how do I install the mysql gem without adding it to the Gemfile in order to make a simple require 'mysql2' work?


(Jens Maier) #10

Adding it to the Gemfile is a dirty, dirty hack… most users will try to run the importer, get the error that mysql2 can’t be loaded and will either give up and/or come to Meta for help.

Anyway, moving the require line to the top of the file did actually work for me. The gem is installed in ~/.gem/ruby/2.2.0 and Ruby seems to have no problems picking it up from that directory even without any special environment variables or config files.


(Gerhard Schlager) #11

Ah, I see, it works when I run the script from the shell but not in my IDE. :disappointed:
Edit: Found the right checkbox. Now it works in my IDE too. No more editing the Gemfile. :smiley:


(Abdul Munim Zahid) #12

Can you guide me a little bit on how to set up a local mysql server and populate it with data from my mybb database?


(Cy) #13

I am getting at all times this:

    # sudo ruby vbulletin.rb 
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- mysql2 (LoadError)
	from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from vbulletin.rb:1:in `<main>'

Do you have any advices? I am on 1.4 latest. I can’t run the import script @elberet


(Abdul Munim Zahid) #14

Are you sure you have the mysql2 gem installed?

Try installing it in this directory as @elberet suggested:
~/.gem/ruby/2.2.0

Worked for me back then!


(Jens Maier) #15

You’re not supposed to run the migration script as root. If you really have to run it with admin privileges for some reason, make sure that any required gems are either installed globally or exist in root’s ~/.gem.


#16

I just used the script and the import went well, but didn’t migrate the user passwords. Is that by design, or am I missing something?


(Mittineague) #17

Unless things have changed since when we migrated from vB, ~11 months ago, members needed to create a new password.


(Gerhard Schlager) #18

Currently none of the importers can migrate passwords. @michaeld talked about adding support for the discourse-migratepassword plugin to the base importer. Not sure if he’s still planning on doing it.


(SentinelX101) #19

I’m having trouble with an error once the mybb.rb script is running after following the solution that @dandv used.

loading existing groups...
loading existing users...
loading existing categories...
loading existing posts...
loading existing topics...

creating users
/var/www/discourse/script/import_scripts/mybb.rb:51:in `block in import_users': undefined local variable or method `users' for #<ImportScripts::MyBB:0x007f1cb24e0108> (NameError)
        from /var/www/discourse/script/import_scripts/base.rb:670:in `block in batches'
        from /var/www/discourse/script/import_scripts/base.rb:669:in `loop'
        from /var/www/discourse/script/import_scripts/base.rb:669:in `batches'
        from /var/www/discourse/script/import_scripts/mybb.rb:39:in `import_users'
        from /var/www/discourse/script/import_scripts/mybb.rb:24:in `execute'
        from /var/www/discourse/script/import_scripts/base.rb:45:in `perform'
        from /var/www/discourse/script/import_scripts/mybb.rb:189:in `<main>'

I have absolutely no idea what’s causing it, can anyone lend a hand?

Edit: Fixed in recent commit. Thanks @techAPJ and @riking.

https://github.com/techAPJ/discourse/commit/38d8d46a4bfaee62ffb589a9d93991a0e31ae244


(Alex Coto) #20

Hey guys, is there any chance you can add support for attachment migration to this script? This would be really helpful.