Install and import Mysql on the development environment

AI-generated summary

Install and import Mysql on the development environment

The discussion revolves around importing a Mybb forum database into a local Discourse installation on an Ubuntu 16.04 machine. bekircem initially tries to use ./launcher enter app, which fails due to being a Docker command not applicable to the development environment.

bekircem is advised to skip this step and proceed with installing the necessary packages, including the MySQL client, and then running the import script. pfaffman confirms that the importer should be run on the development environment, and then the database can be backed up and uploaded to the production server.

To summarize the steps:

  • Install the MySQL client and other necessary packages: apt-get install libmysqlclient-dev mc -y
  • Install the MySQL2 gem: gem install mysql2
  • Run the import script after setting up the database: RAILS_ENV=production ruby mybb.rb

Note that bekircem should create a database, import the backup database, and then run the import script.

Hi there!

I’ve installed development environment on my Ubuntu 16.04 local machine by following this tutorial. Everything is fine. Discourse is work perfect on localhost:3000.

I want to import my Mybb forum database to my local Discourse installation. I want to apply the steps there, but when i use ./launcher enter app it failed. (bash: ./launcher no such file or directory)

cd /var/discourse
./launcher enter app
apt-get update
apt-get install libmysqlclient-dev mc -y
gem install mysql2  # mysql2-0.3.18 got installed
su - discourse
cd /var/www/discourse/script/import_scripts
bundle install
mcedit mybb.rb  # make edits to the MySQL connection details
RAILS_ENV=production ruby mybb.rb  # no idea what "bundle exec" does

What should do I have to do sequentially? What should pay attention? I look forward to your suggestions. Thank you.

@pfaffman

In your linked tutorial he used Docker environment instead of development environment which you used. ./launcher enter app is docker command. It is not needed in development environment.

Oh. You have a point there! I forgot this. So Should i continue by skipping this step like this?

cd /var/discourse
apt-get update
apt-get install libmysqlclient-dev mc -y
gem install mysql2  # mysql2-0.3.18 got installed
cd /var/www/discourse/script/import_scripts
bundle install
mcedit mybb.rb
RAILS_ENV=production ruby mybb.rb

You’ll run the importer on your development environment. When it’s done, back up the database from the web interface and upload that file to your production server.

Should i install mysql client, create database, import my backup database and after run import script, right?

apt-get install libmysqlclient-dev mc -y

Thank you for answer.