Whenever I issue the command: RAILS_ENV=production bundle exec ruby script/import_scripts/xenforo.rb
I get:
/var/discourse/script/import_scripts/base.rb:14:in `require_relative': cannot load such file -- /var/discourse/config/environment (LoadError)
from /var/discourse/script/import_scripts/base.rb:14:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from script/import_scripts/xenforo.rb:3:in `<main>'
or
script/import_scripts/xenforo.rb:1:in `require': cannot load such file -- mysql2 (LoadError)
from script/import_scripts/xenforo.rb:1:in `<main>'
Been messing with the import process for a bit and am stumped, every time I find a solution to one aspect there seems to be another issues. Definitely not user friendly on imports yet. Hope to write a detailed step by step guide to importing Xenforo here for anyone that follows whenever Iām able to get it to work.
If anyone knows which steps to follow to start the import process that would be helpful. I couldnāt find anything related to the xenforo import steps other than whatās in that script.
@riking & @thefreekick ā since you all posted on the other thread, any idea what the steps are to actually perform the migration? There is no documentation surrounding it and Iām just going further away from the solution at this point, it has to be simpler than this surely.
I created a brand new install on Ubuntu 14.04 LTS following the docker install guide, ensured it worked, have had trouble ever since trying to get the import script to run (entered my DB info, installed any related dependencies I found in other threads for other imports, etc) ā I have no clue how to actually run the import and there isnāt really any steps outlined in any threads on here, at least not related to the xenforo import script.
Thanks, but Iāve gone through those as my main resource to figuring it out since itās the only things really written about the imports here, not much of anything is written on the xenforo importer and nothing mentioning the solution to the issues Iām having with it so far. One person mentioned a somewhat similar issue but was never given an answer.
The only remotely viable solution / workaround Iāve seen is going from Xenforo > phpBB3 > Discourse, not only would that greatly lengthen the time it would take to migrate and possibly cause other issues, the only Xenforo > phpBB3 converter I found hasnāt been updated in years so likely isnāt even compatible. Which means Iād have to probably import it to another forum software, then import it to phpBB3, then import it to Discourse. At that point it wouldnāt be worth the time or effort, I would rather just spend that time optimizing Xenforo further.
Without being able to import the users, topics, and posts to Discourse weāre unable to switch over. We canāt start from scratch.
mysql2 is installed in the container. The error OP is what I get if I try to run it outside of the container, the errors here are what I get when I enter ā./launcher enter appā. Iām completely lost in this process.
When I enter: RAILS_ENV=production bundle exec ruby script/import_scripts/xenforo.rb
I get:
/usr/local/bin/ruby: No such file or directory -- /script/import_scripts/xenforo.rb (LoadError)
When I enter: ruby script/import_scripts/xenforo.rb
I get:
URGENT: FATAL: Peer authentication failed for user "discourse"
Failed to initialize site default
/usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize': FATAL: Peer authentication failed for user "discourse" (PG::ConnectionBad)
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
from /usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
from /usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_handling.rb:87:in `connection'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/model_schema.rb:230:in `table_exists?'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/attribute_methods/primary_key.rb:97:in `get_primary_key'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/attribute_methods/primary_key.rb:85:in `reset_primary_key'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/attribute_methods/primary_key.rb:73:in `primary_key'
from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.2.6/lib/active_record/core.rb:132:in `find'
from /var/www/discourse/script/import_scripts/base.rb:464:in `<class:Base>'
from /var/www/discourse/script/import_scripts/base.rb:20:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from script/import_scripts/xenforo.rb:3:in `<main>'
script/import_scripts/xenforo.rb:1:in `require': cannot load such file -- mysql2 (LoadError)
from script/import_scripts/xenforo.rb:1:in `<main>'
Yet when I do āgem listā ā it says mysql 2 is installed, and I even reinstalled it just to be sure.
A simpler way to import would be good, but if this one works for users, posts, topics, etc (the main aspects) then figuring out how to run it would be good enough for our migration at least.