I finally got mine to work by using RAILS_ENV=production sudo -E -u discourse rake import:facebook_group with root user, instead of just the rake import:facebook_group per instructions. Not sure why that is?
Some tips for beginners…
Just did this successfully with a pretty small Facebook group. I’m new to Discourse and ruby - but I can Google So some tips below if any other newbies come along and need some help. I’m using the Docker for my Discourse install.
The instructions refer to “config” and “lib” folders. Those are only accessible to you through ssh and doing cd to /var/discourse then ./launcher ssh app then the “config” and “lib” folders are in /var/www/discourse
To get files (namely import_facebook.yml and import_facebook.rake) into those folders, you’ll have to do this by placing the files via SFTP into /var/discourse/shared/standalone. Then those files are available on the ./launcher ssh app side (for lack of a better term) in /var/www/discourse and you can use a command like mv to move them into the appropriate lib and config folders.
Regarding installing the koala gem before you get started, that’s also by first accessing the ./launcher ssh app area and doing cd to /var/www/discourse. An easy way to add koala to the gemfile is to run gem install gemrat then gemrat koala. Then after that you can run bundle install but it will probably warn you about the Gemfile.lock. I just followed per the error instructions and ran bundle install --no-deployment with success.
When it was all done, it crashed my Discourse I have 2GB of RAM and the import went great, but once it started processing the new users, I got the white screen on my site and it stopped working. So I waited a little bit, then rebuilt my Discourse using ./launcher - now it’s working great. That had the added benefit of cleaning out the koala gem and Gemfile settings (I was a bit wary of how I had done the bundle install as root).
Be warned! Even with the fake email addresses set, it will still attempt a lot of emails! So you may want to change your SMTP settings (Mandrill for instance has a “test” API you can use that doesn’t actually email out), so you don’t get a lot of bounceback notifications.
That’s all. I know this probably isn’t the cleanest way to do it - but if there are any other beginners out there that need the gaps filled in, hope this helps.
This week I’m bit busy, but I’ll have a look at it after that. Your text is helpful in making the transition from pre-Docker to post-Docker.
The thing with this plugin is that it’s not very Docker friendly. It’s also not part of the ‘official’ importers, those work differently. But it’s the only Facebook importer, so we’ll have to work with it.
When trying to claim an account, a new account is created instead of claiming the existing account.
There is a mismatch between the user ID’s , I guess because of the “app scoping”. Does the token that is used making the import have to be connected in some way to the Facebook login configuration on Discourse in any way? If so, how?
Of course it isn’t - that wouldn’t be very secure. I think the email address isn’t being used either ? I think the “link” is being compared, but the link is specific to the FB app, and the key used during import and the key/secret for FB auth aren’t seeing the same user.
Being new to all things Rails/Docker myself, I’m following through @jesselperry very helpful tips.
I’ve dropped the files from github into /var/discourse/shared/standalone, but the files aren’t showing up (or I just don’t know where to look) in /var/www/discourse after ./launcher enter app.
How do I move them to the right place? Is there a step required to get them to show up, and/or which directory should I find the files in after entering the app?
[RESOLVED] found ./shared/config/import_facebook.yml by using find . -name *\facebook.yml\* from / after entering the app. I’d previously been using find from /var/www/discourse and getting no results.