From 4905d106ee0b2b7c219cead4587cba1c6cc22d80 Mon Sep 17 00:00:00 2001 From: tanmoysrt <57363826+tanmoysrt@users.noreply.github.com> Date: Fri, 24 Jan 2025 00:12:28 +0530 Subject: [PATCH] refactor(physical-backup): Send files metadata while restore --- press/agent.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/press/agent.py b/press/agent.py index 9f916a74bc..d93720d4c5 100644 --- a/press/agent.py +++ b/press/agent.py @@ -485,6 +485,9 @@ def physical_backup_database(self, site: Site, site_backup: SiteBackup): def physical_restore_database(self, site, backup_restoration: PhysicalBackupRestoration): backup: SiteBackup = frappe.get_doc("Site Backup", backup_restoration.site_backup) + files_metadata = {} + for item in backup.files_metadata: + files_metadata[item.name] = {"size": item.size, "checksum": item.checksum} data = { "backup_db": backup_restoration.source_database, "target_db": backup_restoration.destination_database, @@ -492,6 +495,7 @@ def physical_restore_database(self, site, backup_restoration: PhysicalBackupRest "private_ip": frappe.get_value( "Database Server", frappe.db.get_value("Server", site.server, "database_server"), "private_ip" ), + "files_metadata": files_metadata, "innodb_tables": json.loads(backup.innodb_tables), "myisam_tables": json.loads(backup.myisam_tables), "table_schema": backup.table_schema,