Timothy J. Baek 7 months ago
parent
commit
9d25207b83
1 changed files with 5 additions and 2 deletions
  1. 5 2
      backend/open_webui/env.py

+ 5 - 2
backend/open_webui/env.py

@@ -221,8 +221,11 @@ if FROM_INIT_PY:
             else:
             else:
                 shutil.copy2(item, dest)
                 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"))
     DATA_DIR = Path(os.getenv("DATA_DIR", OPEN_WEBUI_DIR / "data"))