Skip to content

Importing database dumps

Saray Cabrera Padrón edited this page Apr 6, 2020 · 6 revisions

We now have a dedicated script to import database dumps for testing purpose. It is located in open-build-service/src/api/script/import_database.rb.

Download and import db dump

  1. To download and import a dump from a remote host you need to specify the remote server in src/api/config/options.yml, (backup_server, backup_user, backup_location, backup_filename). In the production machine we can find daily backups in /home/obsdbbackup/backup/.
  2. ./open-build-service/src/api/script/import_database.rb --all will download the database dump from the remote server and stores it in src/api/db/data/. Finally it will import it into your api_development MySQL database.
  3. If you don't want to download the dump from a remote server, you place the dump in src/api/db/data/ and run ./open-build-service/src/api/script/import_database.rb --import
  4. For more options see ./open-build-service/src/api/script/import_database.rb --help

Depending on the size of the dump it can last 10-15 minutes to download and import.

Clone this wiki locally