fix: Deprecate site_config_backup_path in BackupGeneratorversion-14
@@ -97,7 +97,7 @@ def backup_to_dropbox(upload_db_backup=True): | |||||
if frappe.flags.create_new_backup: | if frappe.flags.create_new_backup: | ||||
backup = new_backup(ignore_files=True) | backup = new_backup(ignore_files=True) | ||||
filename = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_db)) | filename = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_db)) | ||||
site_config = os.path.join(get_backups_path(), os.path.basename(backup.site_config_backup_path)) | |||||
site_config = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_conf)) | |||||
else: | else: | ||||
filename, site_config = get_latest_backup_file() | filename, site_config = get_latest_backup_file() | ||||
@@ -191,7 +191,7 @@ def upload_system_backup_to_google_drive(): | |||||
backup = new_backup() | backup = new_backup() | ||||
file_urls = [] | file_urls = [] | ||||
file_urls.append(backup.backup_path_db) | file_urls.append(backup.backup_path_db) | ||||
file_urls.append(backup.site_config_backup_path) | |||||
file_urls.append(backup.backup_path_conf) | |||||
if account.file_backup: | if account.file_backup: | ||||
file_urls.append(backup.backup_path_files) | file_urls.append(backup.backup_path_files) | ||||
@@ -118,7 +118,7 @@ def backup_to_s3(): | |||||
backup = new_backup(ignore_files=False, backup_path_db=None, | backup = new_backup(ignore_files=False, backup_path_db=None, | ||||
backup_path_files=None, backup_path_private_files=None, force=True) | backup_path_files=None, backup_path_private_files=None, force=True) | ||||
db_filename = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_db)) | db_filename = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_db)) | ||||
site_config = os.path.join(get_backups_path(), os.path.basename(backup.site_config_backup_path)) | |||||
site_config = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_conf)) | |||||
if backup_files: | if backup_files: | ||||
files_filename = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_files)) | files_filename = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_files)) | ||||
private_files = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_private_files)) | private_files = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_private_files)) | ||||
@@ -68,6 +68,12 @@ class BackupGenerator: | |||||
dir = os.path.dirname(file_path) | dir = os.path.dirname(file_path) | ||||
os.makedirs(dir, exist_ok=True) | os.makedirs(dir, exist_ok=True) | ||||
@property | |||||
def site_config_backup_path(self): | |||||
# For backwards compatibility | |||||
import click | |||||
click.secho("BackupGenerator.site_config_backup_path has been deprecated in favour of BackupGenerator.backup_path_conf", fg="yellow") | |||||
return getattr(self, "backup_path_conf", None) | |||||
def get_backup(self, older_than=24, ignore_files=False, force=False): | def get_backup(self, older_than=24, ignore_files=False, force=False): | ||||
""" | """ | ||||
@@ -96,7 +102,7 @@ class BackupGenerator: | |||||
self.backup_path_files = last_file | self.backup_path_files = last_file | ||||
self.backup_path_db = last_db | self.backup_path_db = last_db | ||||
self.backup_path_private_files = last_private_file | self.backup_path_private_files = last_private_file | ||||
self.site_config_backup_path = site_config_backup_path | |||||
self.backup_path_conf = site_config_backup_path | |||||
def set_backup_file_name(self): | def set_backup_file_name(self): | ||||
#Generate a random name using today's date and a 8 digit random number | #Generate a random name using today's date and a 8 digit random number | ||||