BookStack script leaves users in a questionable state in regards to updates #158

Closed
opened 2026-02-04 16:52:37 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @ssddanbrown on GitHub (Dec 9, 2024).

Please verify that you have read and understood the guidelines.

yes

A clear and concise description of the issue.

Currently the script is downloading BookStack from its source ZIP on GitHub, then unzipping that into a /opt/bookstack directory.

When it comes to updates, I'm not sure what's expected to occur, but the update script is getting the new version ZIP from GitHub, then extracting this before moving it into the /opt/bookstack directory:

e4354c1d53/ct/bookstack.sh (L69-L71)

From my understanding, and later test of the script, this results in the new version files just being moved within the existing install (for example, at /opt/bookstack/BookStack-24.10.3 if going between the latest releases) so does not actually result in an update.

Based upon how the .env file is handled, i assume that the intent is for the original install folder to be wiped out first then replaced, (which would change the behaviour of the mv to make sense) but this would be dangerous if intended because I can't see any handling of other potential user files (Uploaded images, customizations, attachments etc...).
Maybe the intent is some kind of merge/overwrite, but then I can't see how core app file/folder removals would be handled as expected.

Generally, the approach taken (manual handling of the source ZIP archives) is not an approach that's officially supported in BookStack, nor is common or expected, so attempts like this need careful consideration. The official guidance currently uses git to manage the core code-base.

For context, I'm the maintainer of BookStack and have encountered this while attempting to support a user to update.

What settings are you currently utilizing?

  • Default Settings
  • Advanced Settings

Which Linux distribution are you employing?

Debian 12

If relevant, including screenshots or a code block can be helpful in clarifying the issue.

No response

Please provide detailed steps to reproduce the issue.

No response

Originally created by @ssddanbrown on GitHub (Dec 9, 2024). ### Please verify that you have read and understood the guidelines. yes ### A clear and concise description of the issue. Currently [the script](https://github.com/community-scripts/ProxmoxVE/blob/e4354c1d53ca37eab38d898a33644241d072d8a8/install/bookstack-install.sh#L48-L50) is downloading BookStack from its source ZIP on GitHub, then unzipping that into a `/opt/bookstack` directory. When it comes to updates, I'm not sure what's expected to occur, but the update script is getting the new version ZIP from GitHub, then extracting this before moving it into the /opt/bookstack directory: https://github.com/community-scripts/ProxmoxVE/blob/e4354c1d53ca37eab38d898a33644241d072d8a8/ct/bookstack.sh#L69-L71 From my understanding, and later test of the script, this results in the new version files just being moved within the existing install (for example, at `/opt/bookstack/BookStack-24.10.3` if going between the latest releases) so does not actually result in an update. Based upon how the `.env` file is handled, i assume that the intent is for the original install folder to be wiped out first then replaced, (which would change the behaviour of the `mv` to make sense) but this would be dangerous if intended because I can't see any handling of other potential user files (Uploaded images, customizations, attachments etc...). Maybe the intent is some kind of merge/overwrite, but then I can't see how core app file/folder removals would be handled as expected. Generally, the approach taken (manual handling of the source ZIP archives) is not an approach that's officially supported in BookStack, nor is common or expected, so attempts like this need careful consideration. The official guidance currently uses git to manage the core code-base. For context, I'm the maintainer of BookStack and have encountered this while attempting to support a user to update. ### What settings are you currently utilizing? - [ ] Default Settings - [X] Advanced Settings ### Which Linux distribution are you employing? Debian 12 ### If relevant, including screenshots or a code block can be helpful in clarifying the issue. _No response_ ### Please provide detailed steps to reproduce the issue. _No response_
OVERLORD added the bug label 2026-02-04 16:52:37 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Dec 9, 2024):

As a workaround, from my testing users could convert their script-installed instance to be git-managed, via the following commands:

Backup/Snapshot first before running the below

cd /opt/bookstack
git init
git config --global --add safe.directory /opt/bookstack
git remote add origin https://github.com/BookStackApp/BookStack.git
git fetch
git checkout -f origin/release

The standard BookStack update guidance can then be followed (while being at the /opt/bookstack location in the container). This step must be done if not already on the latest version, and should be done anyway even if you think you are to be sure all is working and up-to-date.

Edit: The existing update script also affects the permissions of the .env file, which can lead to loss of database access for BookStack. This should be fixable by running chown $USER:www-data .env from the /opt/bookstack directory.

@ssddanbrown commented on GitHub (Dec 9, 2024): As a workaround, from my testing users could convert their script-installed instance to be git-managed, via the following commands: **Backup/Snapshot first before running the below** ```bash cd /opt/bookstack git init git config --global --add safe.directory /opt/bookstack git remote add origin https://github.com/BookStackApp/BookStack.git git fetch git checkout -f origin/release ``` The [standard BookStack update guidance](https://www.bookstackapp.com/docs/admin/updates/) can then be followed (while being at the `/opt/bookstack` location in the container). This step must be done if not already on the latest version, and should be done anyway even if you think you are to be sure all is working and up-to-date. **Edit**: The existing update script also affects the permissions of the `.env` file, which can lead to loss of database access for BookStack. This should be fixable by running `chown $USER:www-data .env` from the `/opt/bookstack` directory.
Author
Owner

@havardthom commented on GitHub (Dec 9, 2024):

We usually backup old release -> remove old release -> fetch new release -> restore user data/config -> install new release. Not sure why this has not been done in this script.
Relevant docs for files to backup and restore: https://www.bookstackapp.com/docs/admin/backup-restore/

@havardthom commented on GitHub (Dec 9, 2024): We usually backup old release -> remove old release -> fetch new release -> restore user data/config -> install new release. Not sure why this has not been done in this script. Relevant docs for files to backup and restore: https://www.bookstackapp.com/docs/admin/backup-restore/
Author
Owner

@Hindin81 commented on GitHub (Dec 9, 2024):

I used it to get my installation up and running again. Thanks again for the great support.

@Hindin81 commented on GitHub (Dec 9, 2024): I used it to get my installation up and running again. Thanks again for the great support.
Author
Owner

@michelroegl-brunner commented on GitHub (Dec 10, 2024):

@havardthom I will have a look at it tomorrow and rework the script to follow the official guidline.

@michelroegl-brunner commented on GitHub (Dec 10, 2024): @havardthom I will have a look at it tomorrow and rework the script to follow the official guidline.
Author
Owner

@michelroegl-brunner commented on GitHub (Dec 19, 2024):

Fixed

@michelroegl-brunner commented on GitHub (Dec 19, 2024): Fixed
Author
Owner

@Hindin81 commented on GitHub (Dec 24, 2024):

The update script is still not working correct, after the update to v24.12 all my files and pictures I have uploaded are gone.
The files are stored under: public/uploads and storage/uploads
The update was working fine no error, but the files were not migrated.

@Hindin81 commented on GitHub (Dec 24, 2024): The update script is still not working correct, after the update to v24.12 all my files and pictures I have uploaded are gone. The files are stored under: public/uploads and storage/uploads The update was working fine no error, but the files were not migrated.
Author
Owner

@MickLesk commented on GitHub (Dec 24, 2024):

Create an new issue. Not the old completed

@MickLesk commented on GitHub (Dec 24, 2024): Create an new issue. Not the old completed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#158