Skip to content

Sqlite Container initialisation with existing DB #2107

@josefhuberfhcp

Description

@josefhuberfhcp

Hi, i'am trying to set up a new wiki for my company using sqlite as the database type.
I am having troubles using the environmental variable DB_FILEPATH when creating the container with the following command:
docker run -d -p 8000:3000 --name MyWiki--restart unless-stopped -e "DB_TYPE=sqlite" -e "DB_FILEPATH =/DB.sqlite" requarks/wiki:2.4

After finishing the setup the database is located in the container in the \wiki\ folder with a name of "undefined" without the .sqlite extension. This is mirrored in the "Systems info" in the administrative area:

image

How do i use DB_FILEPATH variable correctly in order to reflect the path/name i specified (DB.sqlite)? (My current workaround: in the container edit the config.yml and change storage: $(DB_FILEPATH) to storage: DB.sqlite and rename the file "undefined" to "DB.sqlite", seems to work and "System Info" prints the right file name.

Secondly, i would like to backup the sqlite file and restore it in a new container. Therefore i copied the sqlite file from container1 to my local file system, set up container2 with the same settings and copied the file into container2, overwriting the newly created db and restarted container2. Unfortunately this seems to break container2:
image
I do not understand the nature of the migration lock error, when i open the sqlite file there is a migrations_lock table but the value ist set to zero.
image
What would be the right way to backup and redeploy a sqlite database in a new container?

It's my first time working with a wiki and also docker, any input would be much appreciated. Thank you.

Host Info
OS: [Windows 10 Home, Docker]
Wiki.js version: [2.4.107]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions