As our GitlabHQ setup at SRMvision is mean to stay, we wanted to migrate from the standard SQLite database to an easier to manage for us : mySQL.
The steps are quite straighforward, first, setup mySQL :
create database gitlab; grant all privileges on gitlab.* to "gitlab" identified by "gitlab"; flush privileges;
bundle exec rake db:data:dump RAILS_ENV=production
mv config/database.yml config/database.yml.old cp config/database.yml.example config/database.yml
development: adapter: mysql2 encoding: utf8 reconnect: false database: gitlabhq_development pool: 5 username: root password: "secure password" # socket: /tmp/mysql.sock # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql2 encoding: utf8 reconnect: false database: gitlabhq_test pool: 5 username: root password: "secure password" # socket: /tmp/mysql.sock production: adapter: mysql2 encoding: utf8 reconnect: true # allows to autoreconnect if the mysql service restarts database: gitlab # to replace with your database name pool: 5 username: gitlab # to replace with your credentials password: "gitlab" # to replace with your credentials socket: /var/run/mysqld/mysqld.sock # mysql socket location on debian
bundle exec rake db:setup RAILS_ENV=production bundle exec rake db:data:load RAILS_ENV=production