I have setup everything and tried to import flarum_import.rb. But it says thimira@THIMIRA:~/discourse/script/import_scripts$ bundle exec ruby flarum_import.rb Traceback (most recent call last): 1: from flarum_import.rb:3:in '`
It’s not needed to manually add these gems to the Gemfile nowadays, they are already there. You just need to enable them by using IMPORT=1 in front of your command.
My experience is that if you do the IMPORT=1 you get a bunch of failures if you haven’t installed all of the dependencies for all of the extra import stuff, and a couple of those are tricky to figure out.
Then it might work. That’s what I’ll try next; For a time I rolled my own templates to install those dependencies, but hope to have found that I never needed to.
I gave it a shot but his setup has a db table prefix and the script has no setting for the prefix. I’ve asked him to rename the tables and I’ll try again.
. . . but the import templates add the Gem to the Gemfile, so if you try to use ``IMPORT=1` then you get
[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: sqlite3 (~> 1.3, >= 1.3.13) and sqlite3 (>= 0). Bundler cannot continue.
# from /var/www/discourse/Gemfile:272
# -------------------------------------------
# gem 'mysql2'
> gem 'sqlite3'
# gem 'tiny_tds'
# -------------------------------------------
Because the Gemfile specifies a version and the template doesn’t.
So after trying pretty hard, I’m not finding a way to make IMPORT=1 be useful. I guess it would work on a development instance where you installed all of those dependencies in the OS, or you hand-rolled a way to install the dependencies in a container.
Oh, but the mbox import does much more than install sqlite3, so that’s not a good thing to do unless you really want to import an mbox.
Maybe I’ll submit a PR for an sqlite3 import template.