Database corruption/loss consequences

Dear Community,
I have tried to search though the Manual but haven’t found any answer to the question I’m interested in. So I’m posting it here…
If my databases get corrupted or lost, will I be able to re-create them from the data in data directory?
If I lose seafile.db, does that mean I lose all the history and trash?
Thank you

By what I know about architecture and database. There should be way how to restore files without database. But theres no utility cause seafile-fsck using database too.

Result is if it happend and you pay to developers for their time I think that they are able with their knowledge to restore it. But at the edge you will have to add restored files to new Seafile instance manually.

There are two kind of people. Those who make backups and those who have not yet lost their data.

The Manual Says: “You need to stop Seafile server first before backing up SQLite database”. So that’s not very easy to backup the DB on a regular basis.
As for developers time, the Manual says “you can use seaf-fsck to export all the files in libraries to external file system” and “This procedure doesn’t rely on the seafile database”. So the developers have already implemented the restoration procedure (it would be impossible to restore data correctly without taking history and trash into account).
I have some experience working with Bacula backup solution. It can restore its catalog from data. Don’t understand, why Seafile can’t do the same.
Thank you for the reply anyways.

I’m not expert over SQLite. I’m using MySQL and there is no problem to make backup on running seafile. Maybe it’s possible to restore data but I think that Encrypted library cannot be exported over FSCK(no sure) so this data are lost. And same is about history.

I have less than 10 users and my seafile.db is only 76KB in size. I see no point in using MySQL - it will add huge overhead without any benefit.

Yes that’s true. I have it same but using database for more services

I think it is possible to backup the database without stopping Seafile. Make sure to check the consistency after copying it and try to copy it again in case it was corrupt. I recommend to first backup the database and then start backing up the actual data. This way a restore is most likely to work, while the database could refer to data which is not part of the backup if being done the other way around.

The information on Sqlite3 I’ve found states that .dump produces consistent backups by means of locking the DB during dump. Why Seafile Manual says that I need to stop the Seafile server before issuing .dump?
Regarding copying DB file while the server is running - I would not do that. Backup is likely to be corrupted in such scenario.

Of course, if you have a client that syncs all the files, those files on that client can be periodically backed-up and subsequently used to fully-restore the data in a fresh Seafile server installation if necessary.

I’m interested not only in data but also in history.
What will happen if my DB is outdated due to restoration from a backup and I turn on a machine with Seafile client? A client will upload differences again or sync back to the state of the data on server?

Seafile is not stupid. It will look which files are newer and then choose way.