Hi again - I can get up to this point in the tutorial
and for me this falls over with error
'Don’t run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. Your Gemfile has no gem server sources. If you need gems that are not already on your machine, add a line like this to your Gemfile: source ‘https://rubygems.org’ Could not find gem ‘mysql2’ in any of the gem sources listed in your Gemfile.
Unfortunately I know nothing about ruby or linux or gemfiles and so am just literally plodding though various discourse cli setup tasks as the tutorials instruct by cutting and pasting commands via PuTTy, without any kind of understanding.
I am running Ubuntu and Discourse in a Digital Oceans Droplet, if that helps?
Also, I see a subsequent reference to pasting database export commands into ‘shell’ . For practical purposes is my current PuTTy connection to the server = ‘shell’, or is some other interface/console involved?
OK, in partial answer to my own question, random thrashing around on forums suggests
$ sudo apt-get install libmysqlclient-dev
will then allow mysql2 gem to install (whatever that is) - ignoring the warning about not doing this as root.
Getting past that and to the next step - typing
$ bundle exec rails db:drop
gives another error::::
bundler: failed to load command: rails (/usr/local/bin/rails) Gem::Exception: can’t find executable rails for gem railties. railties is not currently included in the bundle, perhaps you meant to add it to your Gemfile?
Checking in /usr/local/bin/ and I can see a file named ‘rails’ is definitely there.
Typing $ sudo gem or $ gem install rails or $ sudo gem install rails does not help (per various suggestions stumbled across for this error).
Well I can say categorically that following this guide as written does NOT work for anyone following the official steps for setting up local Dev environment under WSL2 installation of Ubuntu-18.04 under Windows 10 - at almost every step there will be some dependency missing or connection refused error or similar.
With a lot of pain and online research, I have managed to get up to the command:
$ bundle exec ruby script/import_scripts/mybb.rb
but this generates response:
mysql2/client.rb:90:in `connect’: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) (Mysql2::Error::ConnectionError)
This has been a brick wall - nothing I have found by searching online seems to offers a working solution to this
How do I solve this and progress to the next step? Any help much appreciated!
I gave up on DIY in the end and got a developer on the job - referring him to all the great suggestions on this forum (which helped!) - and I believe he achieved this directly on my live Digital Ocean droplet rather than in a separate development environment (so I could review things easily as he worked - users were not impacted as forum not officially live yet.) - in other words I think it is possible.
After a few iterations, results are now pretty good - all the MyCode and strange character issues resolved, translated my MyBB post prefixes as Discourse tags, custom multi-select user profile fields imported successfully.
If he is willing, I will ask him to share any tweaks to standard import script, and other techniques used here.
In case it helps anyone, the developer @rahilqf I engaged completed the project including translation of custom MyBB user fields into Discourse custom user fields (which depends on having the multi-select-user-field plugin installed), MyBB post prefixes translated into Discourse tags, and stripping out of nearly all redundant MyCode tags from MyBB post text.
but http://localhost:3000/ or http://forum.omaggieconcorsi.com:3000/ don’t work
Anyway, the program is converting something, but I don’t know where I can then export the data.
Discourse I can’t see it with http://forum.omaggieconcorsi.com:3000/ or http://localhost:3000/ so how can I at least export the database with posts, users etc. from the old Mybb forum and then import it on new Discourse instance?
I’m trying to import the database from MyBB to discourse. Like @Paul_King I can’t get it to work on my DigitalOcean server. I keep getting all kinds of errors as I follow this guide.
I’m stuck trying to execute the command
$ bundle exec rails db:drop
bundler: command not found: rails
Install missing gem executables with `bundle install`
Bundle install says it’s complete
$ bundle install
Your Gemfile lists the gem mysql2 (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of one of them later.
Using bundler 1.16.1
Using mysql2 0.4.10
Bundle complete! 2 Gemfile dependencies, 2 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Trying to manually install rails results in this:
$ gem install rails
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/racc-1.5.2/ext/racc/cparse
/usr/bin/ruby2.5 -r ./siteconf20210110-8155-1ms05r3.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.5.0/gems/racc-1.5.2 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/racc-1.5.2/gem_make.out
This is extremely frustrating.
Left this post open and managed to install rails. Then had a million other errors and managed to fix them. Errors. On. Every. Single. Step.
Never before I have felt such pure hatred for software. Why is ruby like this? This is a nightmare. I’m now stuck with this error:
Not useful, but I encountered much the same brick walls, both when attempting to set up in a local development environment (to generate a Discourse database file/backup) and directly in my Digital Ocean Droplet. Finally decided after wasting tens of hours that life is too short and got a developer from Fiverr (who took weeks to figure it out, but got there).
I suspect the incentives just aren’t there for anyone to make the process easier.
Best of luck - and I hope if you finally do crack it, you will leave a trail of breadcrumbs on here for others to follow!
However, there may be still something missing because when I try to run bundle exec rails db:drop it tells me Discourse requires Ruby 3.1 or above.
And ruby -v tells me I’m using ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux-gnu].
So I think there’s something wrong with the guides or the scripts.
(Coin-coin le Canapin)
Split this topic