I use Joplin Server as a Docker container and I am very satisfied.
I entered credentials for the postgreSQL-database during the installation, as recommended. However, as the postgreSQL-database hadn't been created, I am sure that this is not used.
I have two questions regarding this:
How can I switch from SQLite to PostgreSQL?
And where can I find the SQLite database in my container? I just can't find it
I have many *.md-files on the server in the "items" folder. Is it possible that I don't use a database at all?
On the other hand I have a "joplin-db-1" (postgres:15) container running within docker. I'm confused...?
I cannot find a SQLite file on the server, nor a PostgreSQL database (postgre not installed on system, /var/lib/postgresql/data doesn't exist.)
However, if I understood correctly, the database solution is recommended for productive use. Therefore I would like to change this very much and would be very happy about a tip how I can do this.
Thank you so much for your support, I really your help!
Here are the log files:
JoplinDB:
2023-09-08 10:19:34.286 UTC [1] LOG: received fast shutdown request
2023-09-08 10:19:34.289 UTC [1] LOG: aborting any active transactions
2023-09-08 10:19:34.295 UTC [141] FATAL: terminating connection due to administrator command
2023-09-08 10:19:34.304 UTC [1] LOG: background worker "logical replication launcher" (PID 31) exited with exit code 1
2023-09-08 10:19:34.304 UTC [32] FATAL: terminating connection due to administrator command
2023-09-08 10:19:34.309 UTC [26] LOG: shutting down
2023-09-08 10:19:34.311 UTC [26] LOG: checkpoint starting: shutdown immediate
2023-09-08 10:19:34.320 UTC [26] LOG: checkpoint complete: wrote 2 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.002 s, sync=0.002 s, total=0.011 s; sync files=2, longest=0.002 s, average=0.001 s; distance=5 kB, estimate=78 kB
2023-09-08 10:19:34.326 UTC [1] LOG: database system is shut down
PostgreSQL Database directory appears to contain a database; Skipping initialization
2023-09-08 10:19:36.870 UTC [1] LOG: starting PostgreSQL 15.4 (Debian 15.4-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2023-09-08 10:19:36.870 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-09-08 10:19:36.870 UTC [1] LOG: listening on IPv6 address "::", port 5432
2023-09-08 10:19:36.873 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-09-08 10:19:36.883 UTC [28] LOG: database system was shut down at 2023-09-08 10:19:34 UTC
2023-09-08 10:19:36.892 UTC [1] LOG: database system is ready to accept connections
JoplinApp:
2023-09-08 10:27:13: App: Content driver: { type: 1 }
2023-09-08 10:27:13: App: Content driver (fallback): null
2023-09-08 10:27:13: App: Trying to connect to database...
2023-09-08 10:27:13: App: Connection check: {
latestMigration: { name: '20221020143305_task_states.js', done: true },
isCreated: true,
error: null
}
2023-09-08 10:27:13: App: Auto-migrating database...
2023-09-08 10:27:13: App: Latest migration: { name: '20221020143305_task_states.js', done: true }
2023-09-08 10:27:13: App: Performing main storage check...
2023-09-08 10:27:13: App: Database storage is special and cannot be checked this way. If the connection to the database was successful then the storage driver should work too.
2023-09-08 10:27:13: App: Starting services...
2023-09-08 10:27:13: ShareService: Starting maintenance...
2023-09-08 10:27:13: EmailService: Starting maintenance...
2023-09-08 10:27:13: TaskService: Scheduling #1 (Delete expired tokens): 0 */6 * * *
2023-09-08 10:27:13: TaskService: Scheduling #2 (Update total sizes): 0 * * * *
2023-09-08 10:27:13: TaskService: Scheduling #3 (Process oversized accounts): 30 */2 * * *
2023-09-08 10:27:13: TaskService: Scheduling #6 (Delete expired sessions): 0 */6 * * *
2023-09-08 10:27:13: TaskService: Scheduling #7 (Compress old changes): 0 0 */2 * *
2023-09-08 10:27:13: TaskService: Scheduling #8 (Process user deletions): 10 * * * *
2023-09-08 10:27:13: TaskService: Scheduling #10 (Process orphaned items): 15 * * * *
2023-09-08 10:27:13: App: Call this for testing: `curl https://domain.tld/api/ping`
2023-09-08 10:27:13: ShareService: Maintenance completed in 46ms
2023-09-08 10:27:14: EmailService: Transporter is operational - service will be enabled
2023-09-08 10:27:14: EmailService: Maintenance completed in 238ms
When I connect via SSH, I don't see any folder under /docker, or /docker/volumes:
You're mounting the database location to /docker/joplindb, that would be a docker directory in your root directory on your local filesystem, is there anything there?
The volume section in your compose file isn't needed as you are mounting to the above location and not an alias.
You are using the admin account as your sync account. I believe that only the admin account has an items view and what it is showing are the sync files stored in your Postgresql database.
It seems that you ought to be able to use any database client to connect to your database and check around the tables and whatnot to see if you can validate/invalidate your theory that the db is not being used. Note that I've not done this, I'm just another Joe User like yourself but from your logs it does appear that the database is being started so provided it's not encrypted I'm guessing you can logon to it.
After launching it (it creates a web admin page), add a server connection to your joplin database using the server db credentials in your original docker command for the db.
Then you can browse the database and see what its up to...
(it also helps you run the backups)
Hint: In portainer I added the pgAdmin docker container to the joplin server db network so they could talk easier...
EDIT: I should add.. messing around in there potentially is dangerous to your data ... be careful