From 042731a7edcfe40f7531789d4f7e1bd94eeaa406 Mon Sep 17 00:00:00 2001 From: Red-GitHubBot <88117545+Red-GitHubBot@users.noreply.github.com> Date: Thu, 23 Sep 2021 22:41:16 +0200 Subject: [PATCH] [3.4] Initialize driver before starting the backup (#5315) (#5342) (cherry picked from commit cb18a663365276592faf662fdc0c6796a366b6a0) Co-authored-by: El Laggron Co-authored-by: El Laggron --- redbot/setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/redbot/setup.py b/redbot/setup.py index fecf94dbd..cd0bc32b6 100644 --- a/redbot/setup.py +++ b/redbot/setup.py @@ -232,7 +232,10 @@ async def create_backup(instance: str, destination_folder: Path = Path.home()) - if backend_type != BackendType.JSON: await do_migration(backend_type, BackendType.JSON) print("Backing up the instance's data...") + driver_cls = drivers.get_driver_class() + await driver_cls.initialize(**data_manager.storage_details()) backup_fpath = await red_create_backup(destination_folder) + await driver_cls.teardown() if backup_fpath is not None: print(f"A backup of {instance} has been made. It is at {backup_fpath}") else: