summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-08-21 16:12:46 +0200
committerRobert Speicher <rspeicher@gmail.com>2015-08-21 09:10:59 -0700
commit06160cfda6af4eade6d110c0f6d01963d12de6fe (patch)
treefc0ee6d806b5e97cec34f41ccfc2d3be0a8e6244
parent31e897ccefd9feac5ca5b1665829cb084a6dcbc4 (diff)
downloadgitlab-ce-06160cfda6af4eade6d110c0f6d01963d12de6fe.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 .
-rw-r--r--lib/backup/database.rb5
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']} ... "