[GH-ISSUE #68] Default sqlite DB location is not included in a Docker volume #5924

Closed
opened 2026-04-20 16:22:45 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @eanmclaughlin on GitHub (Mar 2, 2023).
Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/68

Description

The sqlite DB default location is ./vikunja.db (ie /app/vikunja/vikunja.db in the container).

The Docker configuration section of the docs indicates the only volume required for persistent data is to be mounted at /app/vikunja/files.

None of the sections of the full Docker example page are for an sqlite-based deployment.

Because of all of this, the example configurations and docs do not include the sqlite db file in any persistent storage, resulting in complete loss of user and task data when the container is restarted (I've now lost all my data twice because of this).

Possible fixes:

  • Update the Docker docs to include sections showing sqlite-based deployment configurations, with a new required volume mapped to the sqlite db file location.
  • Update the default location of the sqlite db file to be inside the /app/vikunja/files directory, which is already mapped to a volume in all current Docker examples.

Vikunja Frontend Version

v0.20.3

Vikunja API Version

v0.20.2

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

Originally created by @eanmclaughlin on GitHub (Mar 2, 2023). Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/68 ### Description The [sqlite DB default location](https://vikunja.io/docs/config-options/#path) is `./vikunja.db` (ie `/app/vikunja/vikunja.db` in the container). The [Docker configuration section of the docs](https://vikunja.io/docs/install-backend/#docker) indicates the only volume required for persistent data is to be mounted at `/app/vikunja/files`. None of the sections of the [full Docker example page](https://vikunja.io/docs/full-docker-example/) are for an sqlite-based deployment. Because of all of this, the example configurations and docs do not include the sqlite db file in any persistent storage, resulting in complete loss of user and task data when the container is restarted (I've now lost all my data _twice_ because of this). Possible fixes: - Update the Docker docs to include sections showing sqlite-based deployment configurations, with a new required volume mapped to the sqlite db file location. - Update the default location of the sqlite db file to be inside the `/app/vikunja/files` directory, which is already mapped to a volume in all current Docker examples. ### Vikunja Frontend Version v0.20.3 ### Vikunja API Version v0.20.2 ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
Author
Owner

@kolaente commented on GitHub (Mar 2, 2023):

I think improving the docs is the way to go as most people won't use the docker image with sqlite and thus an extra volume would be unused in most of the cases.

Do you want to send a PR?

<!-- gh-comment-id:1452463001 --> @kolaente commented on GitHub (Mar 2, 2023): I think improving the docs is the way to go as most people won't use the docker image with sqlite and thus an extra volume would be unused in most of the cases. Do you want to send a PR?
Author
Owner

@eanmclaughlin commented on GitHub (Mar 2, 2023):

To be clear, the suggested new volume would only be for sqlite-based deployments.

Additionally, setting the default location of the sqlite db to be inside /app/vikunja/files would ensure things Just Work by default with the current docker configuration guidelines. Would not be an issue for existing sqlite deployments as those already either lose all data on restart or have non-default configuration.

I'm kind of surprised you think most won't use sqlite as this seems a great use case (at least for a single user deployment). I might be an outlier since I tend to want to minimize the number of containers I'm running, and I create and manage them via podman/shell scripts/generated systemd units rather than daemonized docker with compose files.

I'll go take a look at editing the docs to at least add some notes about sqlite docker deployments.

<!-- gh-comment-id:1452495447 --> @eanmclaughlin commented on GitHub (Mar 2, 2023): To be clear, the suggested new volume would only be for sqlite-based deployments. Additionally, setting the default location of the sqlite db to be inside `/app/vikunja/files` would ensure things Just Work by default with the current docker configuration guidelines. Would not be an issue for existing sqlite deployments as those already either lose all data on restart or have non-default configuration. I'm kind of surprised you think most won't use sqlite as this seems a great use case (at least for a single user deployment). I might be an outlier since I tend to want to minimize the number of containers I'm running, and I create and manage them via podman/shell scripts/generated systemd units rather than daemonized docker with compose files. I'll go take a look at editing the docs to at least add some notes about sqlite docker deployments.
Author
Owner

@kolaente commented on GitHub (Mar 3, 2023):

Additionally, setting the default location of the sqlite db to be inside /app/vikunja/files would ensure things Just Work by default with the current docker configuration guidelines. Would not be an issue for existing sqlite deployments as those already either lose all data on restart or have non-default configuration.

This would be a hard breaking change. People might have added a volume to store their sqlite db file, but not the config variable.
It would also affect everyone not using docker and sqlite which is more common than docker + sqlite.

I'm kind of surprised you think most won't use sqlite as this seems a great use case (at least for a single user deployment).

That's probably caused by the ease of spinning up new services with Docker.

I'll go take a look at editing the docs to at least add some notes about sqlite docker deployments.

+1

<!-- gh-comment-id:1453615674 --> @kolaente commented on GitHub (Mar 3, 2023): > Additionally, setting the default location of the sqlite db to be inside /app/vikunja/files would ensure things Just Work by default with the current docker configuration guidelines. Would not be an issue for existing sqlite deployments as those already either lose all data on restart or have non-default configuration. This would be a hard breaking change. People might have added a volume to store their sqlite db file, but not the config variable. It would also affect everyone not using docker and sqlite which is more common than docker + sqlite. > I'm kind of surprised you think most won't use sqlite as this seems a great use case (at least for a single user deployment). That's probably caused by the ease of spinning up new services with Docker. > I'll go take a look at editing the docs to at least add some notes about sqlite docker deployments. +1
Author
Owner

@tandy-1000 commented on GitHub (Mar 12, 2023):

I look forward to these changes, as I also just bumped into this :)
Could you share your docker config @eanmclaughlin?

<!-- gh-comment-id:1465325960 --> @tandy-1000 commented on GitHub (Mar 12, 2023): I look forward to these changes, as I also just bumped into this :) Could you share your docker config @eanmclaughlin?
Author
Owner

@kolaente commented on GitHub (Sep 13, 2024):

The docs now properly reflect this - I'm closing this now. Please ping if you have any additional suggestions.

<!-- gh-comment-id:2348367673 --> @kolaente commented on GitHub (Sep 13, 2024): The docs now properly reflect this - I'm closing this now. Please ping if you have any additional suggestions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#5924