This commit is contained in:
Tobias
2025-11-10 12:19:32 +01:00
committed by GitHub
parent 8141779239
commit da2df6f17c

View File

@@ -30,28 +30,28 @@ function update_script() {
systemctl stop open-webui systemctl stop open-webui
msg_ok "Stopped Service" msg_ok "Stopped Service"
msg_info "Backup old data" msg_info "Creating Backup"
mkdir -p /opt/open-webui-backup mkdir -p /opt/open-webui-backup
cp -a /opt/open-webui/backend/data /opt/open-webui-backup/data || true cp -a /opt/open-webui/backend/data /opt/open-webui-backup/data || true
msg_ok "Backup created" msg_ok "Created Backup"
msg_info "Remove legacy installation" msg_info "Removing legacy installation"
rm -rf /opt/open-webui rm -rf /opt/open-webui
rm -rf /root/.open-webui || true rm -rf /root/.open-webui || true
msg_ok "Legacy removed" msg_ok "Removed legacy installation"
msg_info "Install new uv based Open WebUI" msg_info "Installing uv-based Open-WebUI"
PYTHON_VERSION="3.12" setup_uv PYTHON_VERSION="3.12" setup_uv
$STD uv tool install --python 3.12 open-webui[all] $STD uv tool install --python $PYTHON_VERSION open-webui[all]
msg_ok "Installed new Open WebUI" msg_ok "Installed uv-based Open-WebUI"
msg_info "Restore data" msg_info "Restoring data"
mkdir -p /root/.open-webui mkdir -p /root/.open-webui
cp -a /opt/open-webui-backup/data/* /root/.open-webui/ || true cp -a /opt/open-webui-backup/data/* /root/.open-webui/ || true
rm -rf /opt/open-webui-backup || true rm -rf /opt/open-webui-backup || true
msg_ok "Data restored" msg_ok "Restored data"
msg_info "Recreate service" msg_info "Recreating Service"
cat <<EOF >/etc/systemd/system/open-webui.service cat <<EOF >/etc/systemd/system/open-webui.service
[Unit] [Unit]
Description=Open WebUI Service Description=Open WebUI Service
@@ -73,7 +73,7 @@ EOF
$STD systemctl daemon-reload $STD systemctl daemon-reload
systemctl enable -q --now open-webui systemctl enable -q --now open-webui
msg_ok "Service active" msg_ok "Recreated Service"
msg_ok "Migration completed" msg_ok "Migration completed"
exit 0 exit 0