I am trying to use question2answer.rb importer script to migrate my site to the discourse platform. But I am facing the following error during the migration process.
How to fix it? I am using the default docker container on a clean ubuntu 18.04.
importing users
**Traceback** (most recent call last):
9: from script/import_scripts/question2answer.rb:560:in `<main>'
8: from /var/www/discourse/script/import_scripts/base.rb:47:in `perform'
7: from script/import_scripts/question2answer.rb:71:in `execute'
6: from script/import_scripts/question2answer.rb:85:in `import_users'
5: from script/import_scripts/question2answer.rb:555:in `mysql_query'
4: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.2/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': **Table 'primary_db.users' doesn't exist (** **Mysql2::Error** **)**
I am sorry, Jay. I am not quite sure what you mean by that? Could you please give me some pointers here? I hope that you donât mean by rewriting the importer script of question2answer.
If I can log in remotely to the machine where youâre running the import itâll help, as Iâll be able to see whether it works without sending it to you, having you import, tell me whatâs wrong, and trying again.
It seems the question2answer importer was written for a case where there is an additional set of tables in the database for another app that was integrated with it. That is what the MAIN_APP_DB_NAME refers to.
We have done an import for a standalone q2a site recently and we have a modified version of the script which does not depend on this extra database. @RGJ was going to clean it up and submit it back in the next few weeks.
[Here](https://gist.github.com/Communiteq (formerly DiscourseHosting)/769eff2014d5482f0ab776de03dc3349) is a gist of our modified importer so you donât need to wait for me to clean it up, the code is already pretty ok though.
remove dependency on that other mysterious database which is probably something bespoke
In the recent attempt to migrate small data from my old forum resulted in the following error when I used [modified importer script](https://gist.github.com/Communiteq (formerly DiscourseHosting)/769eff2014d5482f0ab776de03dc3349) provided by @RGJ.
Loading existing groups...
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...
importing users
**Traceback** (most recent call last):
11: from script/import_scripts/question2answer.rb:601:in `<main>'
10: from /var/www/discourse/script/import_scripts/base.rb:47:in `perform'
9: from script/import_scripts/question2answer.rb:70:in `execute'
8: from script/import_scripts/question2answer.rb:89:in `import_users'
7: from /var/www/discourse/script/import_scripts/base.rb:881:in `batches'
6: from /var/www/discourse/script/import_scripts/base.rb:881:in `loop'
5: from /var/www/discourse/script/import_scripts/base.rb:882:in `block in batches'
4: from script/import_scripts/question2answer.rb:106:in `block in import_users'
3: from /var/www/discourse/script/import_scripts/base.rb:247:in `create_users'
2: from /var/www/discourse/script/import_scripts/base.rb:247:in `each'
1: from /var/www/discourse/script/import_scripts/base.rb:278:in `block in create_users'
/var/www/discourse/script/import_scripts/base.rb:866:in `print_status': **undefined method `to_f' for #<Mysql2::Result:0x000056370b7c1f80> (** **NoMethodError** **)**
**Did you mean? to_s**
**to_a**
**to_h**