# MyBB importer script failing at creating users stage

**URL:** <https://meta.discourse.org/t/mybb-importer-script-failing-at-creating-users-stage/33828>\
**Category:** Migration\
**Tags:** mybb\
**Created:** [28 Settembre 2015, 11:00am UTC](https://meta.discourse.org/t/mybb-importer-script-failing-at-creating-users-stage/33828 "2015-09-28T11:00:57Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![SentinelX101](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sentinelx101/32/44700_2.png) [@SentinelX101](https://meta.discourse.org/u/SentinelX101)\
**Post date:** [28 Settembre 2015, 11:00am UTC](https://meta.discourse.org/t/mybb-importer-script-failing-at-creating-users-stage/33828/1 "2015-09-28T11:00:57Z")

</div>

When running the mybb.rb importer script I get the following error.

```
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 was following these exact steps from a previous user who was importing their database from MyBB to Discourse when the error occurred.

> [@Migrating from mybb](https://meta.discourse.org/t/migrating-from-mybb/25563/5):
>
> 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

Thanks.

---

_[View the full topic](https://meta.discourse.org/t/mybb-importer-script-failing-at-creating-users-stage/33828)._
