I have set up a Joplin Server on a Pi5 with postgres as the database and I was wondering about power failures and corruption. It is writing to a Fat32 SD card, and of course if doing a sync is occuring during a power failure I am betting there will be corruption of the database. Is there any way to minimize this? Or recover from it? Or is the system robust enough not to worry about it?
I currently have it in my home directory in docker/joplin where my compose file is as well. I assume backing up that folder is all I need to do to have a copy of everything should it go sideways?
I also turned off heartbeats in the Joplin server admin settings to cut down on the number of writes to the SD card, is there anything else I should/could turn off to lower the writes further? And I assume turning off the heartbeats isn't a issue?
For sure a power failure wouldn't cause any corruption so you shouldn't have to worry about this. Usually database corruption happens when the disk itself is failing so maybe an advise would be to use a quality disk. And also backups of course
Thanks Laurent, that is wonderful news. I hope to move from the SDCard to a SSD eventually which has a lot more durability. But I was careful to get a quality card first.
With regard to backups, did I have it right and just backup/copy the docker/joplin folder to another drive and restore that if needed? Of course doing
Docker compose down
first.
It depends on the storage. By default, the server saves data to an SQLite file within the image I think, so you'd need to backup that SQLite file. If you use Postgres, you need pg_dump. Basically you only need to backup the database
Ah I thought backing up the files would be enough. Glad to find out different now.
I did some searching and found:
Where you mentioned two commands. I tried them but got a permissions error:
permission denied while trying to connect to
the Docker daemon socket at unix:///var/run/d
ocker.sock: Get "http://%2Fvar%2Frun%2Fdocker
.sock/v1.49/containers/joplin-server_db_1/jso
n": dial unix /var/run/docker.sock: connect:
permission denied
So I have the location right, now if I could figure out what permission is missing....