Install and import Mysql on the development environment

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.

2 Likes

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.

4 Likes

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.