From 95416ee5550e9a4e45606b79e647c49415242612 Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Thu, 25 Jun 2020 23:42:55 +0530 Subject: [PATCH] fix: check for all possible site config backups Signed-off-by: Chinmay D. Pai --- build/common/commands/restore_backup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/common/commands/restore_backup.py b/build/common/commands/restore_backup.py index 4d6f9c47..531950d9 100644 --- a/build/common/commands/restore_backup.py +++ b/build/common/commands/restore_backup.py @@ -190,7 +190,9 @@ def main(): latest_backup = max(backups).strftime(DATE_FORMAT) files_base = os.path.join(backup_dir, site, latest_backup, '') files_base += latest_backup + '-' + site_slug - site_config_path = os.path.join(backup_dir, site, 'site_config.json') + site_config_path = files_base + '-site_config_backup.json' + if not os.path.exists(site_config_path): + site_config_path = os.path.join(backup_dir, site, 'site_config.json') if site in get_sites(): restore_database(files_base, site_config_path, site) restore_private_files(files_base)