Migration from Yahoo! Groups

(major edits below–second attempt)

Working on the message import process, using the instructions at Migrating to Discourse from another Forum software. As I understand them, the process should look like:

  • Set up development environment using Beginners Guide to Install Discourse on Ubuntu for Development
  • Install MongoDB on that system
  • On that system, as the same non-privileged user that’s running Discourse, git clone the yahoo-group-export script
  • As the same user, gem install mechanize; gem install mongo. Then edit .config.yaml to give the Yahoo credentials and group name, and run ruby bin/yg-export.rb.
  • Have a cup (or two) of your beverage of choice.
  • Once yg-export finishes, in the Discourse directory, take a look at script/import_scripts/yahoogroup.rb. Edit it to point to the correct MONGODB_HOST (localhost).
  • In the discourse directory, run bundle exec ruby script/import_scripts/yahoogroup.rb
  • Verify it’s imported correctly
  • Backup and restore to a live server

Steps 2-4 are inferred. But does this look like the right steps to follow? Believing they were, I proceeded. It ran fine through step 4–yg-export.rb ran for about an how, reporting SUCCESS for everything, and saving ~38k messages. The database syncro is present with ~85MB of data in it. At that point, I took a snapshot of the VM.

I’m having trouble with the import script, though. When I run bundle exec ruby script/import_scripts/yahoogroup.rb, I get this:

dan@ubuntu:~/discourse$ bundle exec ruby script/import_scripts/yahoogroup.rb
Traceback (most recent call last):
script/import_scripts/yahoogroup.rb: Bootsnap::LoadPathCache::FallbackScan
        7: from script/import_scripts/yahoogroup.rb:4:in `<main>'
        6: from /home/dan/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/kernel.rb:23:in `require'
        5: from /home/dan/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:26:in `require'
        4: from /home/dan/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:40:in `rescue in require'
        3: from /home/dan/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        2: from /home/dan/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
        1: from /home/dan/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/home/dan/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': cannot load such file -- mongo (LoadError)

Strange, I thought I’d already installed the mongo gem. Well, I’ll do it again:

dan@ubuntu:~/discourse$ gem install mongo
Successfully installed mongo-2.10.2
Parsing documentation for mongo-2.10.2
Done installing documentation for mongo after 4 seconds
1 gem installed

Run the import script again, same result. Does it matter if I install it at the system level?

dan@ubuntu:~/discourse$ sudo apt install ruby-mongo
[sudo] password for dan: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ruby-mongo is already the newest version (2.5.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Curiouser and curiouser…