diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-08-21 16:12:46 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-08-21 16:12:46 +0200 |
commit | 4cd06867c76daca698bc4a9d23e1875f4b4866d5 (patch) | |
tree | 8a5acde68944722533582ed8f9599fe49d1c92fd /lib/backup | |
parent | 677bf6615f81ac0f681183a63e9d6d4fbdc5b1c6 (diff) | |
download | gitlab-ce-4cd06867c76daca698bc4a9d23e1875f4b4866d5.tar.gz |
Do not delete the SQL dump too early
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 .
Diffstat (limited to 'lib/backup')
-rw-r--r-- | lib/backup/database.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb index 939f28fc1c6..ce75476a09b 100644 --- a/lib/backup/database.rb +++ b/lib/backup/database.rb @@ -7,14 +7,15 @@ module Backup def initialize @config = YAML.load_file(File.join(Rails.root,'config','database.yml'))[Rails.env] @db_dir = File.join(Gitlab.config.backup.path, 'db') + end + + def dump FileUtils.rm_rf(@db_dir) # Ensure the parent dir of @db_dir exists FileUtils.mkdir_p(Gitlab.config.backup.path) # Fail if somebody raced to create @db_dir before us FileUtils.mkdir(@db_dir, mode: 0700) - end - def dump success = case config["adapter"] when /^mysql/ then $progress.print "Dumping MySQL database #{config['database']} ... " |