From 9d25207b83cb9680f71c9e438bfefe3652bda522 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 26 Sep 2024 03:13:38 +0200 Subject: [PATCH] refac --- backend/open_webui/env.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index 60cf9ba75..4f1403e97 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -221,8 +221,11 @@ if FROM_INIT_PY: else: shutil.copy2(item, dest) - # And rename the old directory to _open_webui/data - DATA_DIR.rename(DATA_DIR.parent / "_open_webui" / "data") + # Zip the data directory + shutil.make_archive(DATA_DIR.parent / "open_webui_data", "zip", DATA_DIR) + + # Remove the old data directory + shutil.rmtree(DATA_DIR) DATA_DIR = Path(os.getenv("DATA_DIR", OPEN_WEBUI_DIR / "data"))