Skip to content

Migrate from SQLite to MySQL

riyad edited this page Oct 23, 2012 · 1 revision

Since v2.3 GitLab officially supports MySQL databases. Follow these steps in order to migrate your data from SQLite to MySQL:

  1. Update to the latest GitLab
  2. Install the MySQL server on your system
  3. Run bundle exec rake db:data:dump RAILS_ENV=production to extract the data currenty stored in SQLite.
  4. Update your database.yml to use MySQL (see database.yml.mysql for an example configuration)
  5. Run bundle exec rake db:setup RAILS_ENV=production to setup your database tables in MySQL.
  6. Run bundle exec rake db:data:load RAILS_ENV=production to load the data saved in step 3 into MySQL.
  7. Rename your db/production.sqlite file (don't delete it yet).
  8. Restart GitLab and test if all the data has been transfered correctly.
  9. Delete your db/*.sqlite files, if you are sure everything worked.
Clone this wiki locally