summaryrefslogtreecommitdiff
path: root/lib/backup/database.rb
Commit message (Collapse)AuthorAgeFilesLines
* Database SSL support for backup script.Guillaume2017-04-051-5/+21
|
* Don’t exclude some file in lib from rubocopDouwe Maan2017-02-231-31/+39
|
* Replace colorize gem with rainbow.Connor Shea2016-06-031-2/+2
| | | | | | | | | | | | | Colorize is a gem licensed under the GPLv2, so we can’t use it in GitLab without relicensing GitLab under the terms of the GPL. Rainbow is licensed under the MIT license and does the exact same thing as Colorize, so Rainbow was added in place of Colorize. The syntax is slightly different for Rainbow vs. Colorize, and was updated in accordance. The gem is still a dependency of Spinach, so it’s included in the development/test environments, but won’t be packaged with the actual product, and therefore doesn’t require we relicense the product. An attempt at relicensing Colorize was made, but didn’t succeed as the library owner never responded. Rainbow library: https://github.com/sickill/rainbow Relevant issue regarding licensing in GitLab's gems: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3775
* Remove superfluous mkdir -pJacob Vosmaer2015-10-061-2/+0
|
* Keep old path: db/database.sql.gzJacob Vosmaer2015-10-061-1/+2
| | | | | Documentation elsewhere refers to this internal path, let's keep it.
* Reduce disk IO during SQL backupJacob Vosmaer2015-10-061-29/+24
| | | | | By using light gzip compression we can save a lot of disk IO during the backup.
* add pg_schema to backup configpg_dump_schemaValery Sizov2015-09-181-2/+6
|
* Do not delete the SQL dump too earlyJacob Vosmaer2015-08-211-2/+3
| | | | | | | | | The change in baa157926d432f404a41c31ad6514ff8d5366269 broke backup restore fucnctionality. This would not lead to data loss, but it prevented the restore script from working. This bug exists only in 7.14.0 release candidate versions, not in 7.13. Reported in https://github.com/gitlabhq/gitlabhq/issues/9571 .
* Workaround the warnings emitted by MySQL 5.6 regarding password on theTed Strzalkowski2015-08-121-2/+5
| | | | command line.
* Stricter mkdir's in 'rake gitlab:backup:create'backup-directory-permissionsJacob Vosmaer2015-07-301-2/+5
|
* Set internal backup directory modes on createJacob Vosmaer2015-07-291-1/+1
| | | | This sidesteps problems with running 'chmod' on some CIFS mounts.
* Don't stop if database.sql.gz already existsoverwrite-during-backupJacob Vosmaer2015-07-211-0/+1
| | | | | | | | The existing behavior of the backups is to overwrite whatever data was still there in the scratch directories. This broke when we added a 'gzip' step because 'gzip database.sql' will fail if 'database.sql.gz' already exists. Doing 'rm -f database.sql.gz' before the 'gzip' avoids this failure.
* Merge branch 'improve-postgres-restore-cleaning' into 'master' Dmitriy Zaporozhets2015-07-071-5/+2
|\ | | | | | | | | | | | | | | | | Use native Postgres database cleaning during backup restore We were using hacks to drop tables etc during a Postgres backup restore. With this change, we let pg_dump insert the DROP TABLE statements it needs at the start of the SQL dump. See merge request !1891
| * Use native Postgres database cleaning during backup restoreJacob Vosmaer2015-07-071-5/+2
| | | | | | | | | | | | We were using hacks to drop tables etc during a Postgres backup restore. With this change, we let pg_dump insert the DROP TABLE statements it needs at the start of the SQL dump.
* | Compress database backupKamil Trzcinski2015-07-061-0/+14
|/
* Add CRON=1 backup setting for quiet backupsJacob Vosmaer2014-11-201-6/+6
|
* Drop all Postgres sequences during backup restoreJacob Vosmaer2014-10-281-0/+1
|
* Fail harder in the backup scriptJacob Vosmaer2014-10-011-0/+2
| | | | | This change also shows the output of failed Git commands during the backup.
* Drop all tables before restoring a PostgreSQL DBJacob Vosmaer2014-03-281-2/+3
| | | | | | Invoking 'db:schema:load' turned out to be a bad idea: when downgrading an existing GitLab installation, the schema of the newer version would be preserved when trying to import the old version.
* Empty the database during Postgres backup restoreJacob Vosmaer2014-02-261-0/+2
| | | | | | | | | | | The expected behavior during a GitLab backup restore is to overwrite existing database data. This works for MySQL because the output of mysqldump contains 'DROP TABLE IF EXISTS' statements. pg_dump on the other hand assumes that one will restore into an empty database. When this is not the case, during the restore with psql some of the data will be skipped if existing data is 'in the way'. By first invoking `rake db:schema:load` during a Postgres GitLab backup restore, we make sure that all important data is correctly restored.
* Report failure of DB backup commandsJacob Vosmaer2014-01-231-2/+16
|
* Remove Bourne shell from backup codeJacob Vosmaer2013-11-061-5/+5
|
* Revert "More escaping"Dmitriy Zaporozhets2013-11-051-6/+5
| | | | This reverts commit c46eaca91247ccf8e6fb3b691dad028e1b084ae3.
* More escapingNigel Kukard2013-11-041-5/+6
| | | | | | | | | - Database name may contain characters which are not shell friendly - Database password could contain the same - While we at it there is no harm in escaping generated paths too - Refactored 2-line system(command) Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
* Fix PostgreSQL database restoration problem (#4217)andrewwutw2013-06-101-1/+1
| | | Use psql instead of pg_restore to restore SQL dump file.
* Fix errors during backup task. Fix #3785Axilleas Pipinellis2013-05-071-1/+1
| | | | | | | | | | | By default there is no public/uploads directory when no attachments are uploaded. Prompt users to create the uploads directory during install otherwise the backup task will fail. Place mysqldump args in single quotes to avoid error if password contains special characters. Signed-off-by: Axilleas Pipinellis <axilleas@archlinux.gr>
* refactor backup/restoreDmitriy Zaporozhets2013-04-051-0/+58