From ed2330edc027ed37b6e32c3ac311ffcdf2458d38 Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 16 Feb 2023 20:01:15 -0500 Subject: [PATCH] Update wikijs-v5.sh fix update process --- ct/wikijs-v5.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ct/wikijs-v5.sh b/ct/wikijs-v5.sh index 6091efaf..2baebf4a 100644 --- a/ct/wikijs-v5.sh +++ b/ct/wikijs-v5.sh @@ -325,17 +325,26 @@ msg_info "Stopping ${APP}" systemctl stop wikijs msg_ok "Stopped ${APP}" +msg_info "Backing up Data" +mkdir -p data-backup +cp -R /opt/wikijs/{db.sqlite,config.yml,/data} ~/data-backup +msg_ok "Backed up Data" + msg_info "Updating ${APP}" -cp /opt/wikijs/config.yml ~/config.yml.bak rm -rf /opt/wikijs/* cd /opt/wikijs -wget https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz &>/dev/null +wget -q https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz tar xzf wiki-js.tar.gz -cp ~/config.yml.bak ./config.yml msg_ok "Updated ${APP}" +msg_info "Restoring Data" +cp -R ~/data-backup/* /opt/wikijs +rm -rf ~/data-backup +npm rebuild sqlite3 &>/dev/null +msg_ok "Restored Data" + msg_info "Starting ${APP}" -systemctl stop wikijs +systemctl start wikijs msg_ok "Started ${APP}" msg_ok "Update Successfull" exit