From 6691a400dab45d461a6c30ea84ff0310a50b9068 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 15 Mar 2018 12:14:08 -0400 Subject: [PATCH] restorer: clarify logging --- lib/backup_restore/restorer.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/backup_restore/restorer.rb b/lib/backup_restore/restorer.rb index 3eed12b157f..6c90d5ace4e 100644 --- a/lib/backup_restore/restorer.rb +++ b/lib/backup_restore/restorer.rb @@ -41,6 +41,7 @@ module BackupRestore extract_dump if !can_restore_into_different_schema? + log "Cannot restore into different schema, restoring in-place" enable_readonly_mode pause_sidekiq @@ -56,6 +57,7 @@ module BackupRestore disable_readonly_mode else + log "Restoring into 'backup' schema" restore_dump enable_readonly_mode @@ -193,10 +195,9 @@ module BackupRestore end def extract_metadata - log "Extracting metadata file..." - @metadata = if system('tar', '--list', '--file', @tar_filename, BackupRestore::METADATA_FILE) + log "Extracting metadata file..." FileUtils.cd(@tmp_directory) do Discourse::Utils.execute_command( 'tar', '--extract', '--file', @tar_filename, BackupRestore::METADATA_FILE, @@ -208,6 +209,7 @@ module BackupRestore raise "Failed to load metadata file." if !data data else + log "No metadata file to extract." if @filename =~ /-#{BackupRestore::VERSION_PREFIX}(\d{14})/ { "version" => Regexp.last_match[1].to_i } else