From be863ab4055ddf681ca88e0895d16117cf302e6c Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Sun, 18 Oct 2026 21:32:11 +0200 Subject: [PATCH] Wiki.js: only back up db.sqlite on SQLite installs (#17993) Installs since February 2025 use PostgreSQL and have no db.sqlite, so the update stopped at the backup (#17971). mkdir -p lets a rerun get past the backup folder a failed run left behind. --- ct/wikijs.sh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/ct/wikijs.sh b/ct/wikijs.sh index 0db786df3..deaca6f32 100644 --- a/ct/wikijs.sh +++ b/ct/wikijs.sh @@ -33,22 +33,18 @@ function update_script() { NODE_VERSION="26" NODE_MODULE="yarn,node-gyp" setup_nodejs if check_for_gh_release "wikijs" "requarks/wiki-v2"; then - #msg_info "Verifying whether ${APP}' new release is v3.x+ and current install uses SQLite." - #SQLITE_INSTALL=$([ -f /opt/wikijs/db.sqlite ] && echo "true" || echo "false") - #if [[ "${SQLITE_INSTALL}" == "true" && "${CHECK_UPDATE_RELEASE}" =~ ^3.* ]]; then - # echo "SQLite is not supported in v3.x+, currently there is no update path availble." - # exit - #fi - #msg_ok "There is an update path available for ${APP}" + # Installs before February 2025 use SQLite, newer ones PostgreSQL + SQLITE_INSTALL=$([[ -f /opt/wikijs/db.sqlite ]] && echo "true" || echo "false") msg_info "Stopping Service" systemctl stop wikijs msg_ok "Stopped Service" msg_info "Backing up Data" - mkdir /opt/wikijs-backup - #$SQLITE_INSTALL && - cp /opt/wikijs/db.sqlite /opt/wikijs-backup + mkdir -p /opt/wikijs-backup + if [[ "$SQLITE_INSTALL" == "true" ]]; then + cp /opt/wikijs/db.sqlite /opt/wikijs-backup + fi cp -R /opt/wikijs/{config.yml,/data} /opt/wikijs-backup msg_ok "Backed up Data" @@ -56,8 +52,9 @@ function update_script() { msg_info "Restoring Data" cp -R /opt/wikijs-backup/* /opt/wikijs - #$SQLITE_INSTALL && - $STD npm rebuild sqlite3 + if [[ "$SQLITE_INSTALL" == "true" ]]; then + $STD npm rebuild sqlite3 + fi rm -rf /opt/wikijs-backup msg_ok "Restored Data"