My practice of running darktable without xmp files may have come back to bite me.
My old PC did a hard crash while I was editing - don’t know why but it basically just cut the power and it went black within second or two. It’s happened before, but not that often. After restarting, I started dt and got this:
I assume it’s only the entry that was being written when the crash occured that’s corrupted - is there a practical way to fix it?
If not I’ll just go back to my most recent backup from a few days ago, but it would be a nuisance.
DT uses SQLite as its database. You could try to recover your DB using the .recover command.
Darktable creates with the defaults settings database snapshots once a week. The name of file is something like library-snp-20230514 (don’t know it by heart). It is stored in the same folder as the library. Depending how much you have changed just before the database got corrupted, you could delete the faulty db file, rename the snapshot and take it from there.
That seems to have worked - I ran C:\Users\User\AppData\Local\darktable>sqlite3 library.db ".recover --ignore-freelist --lost-and-found LOST --no-rowids" >libs.sql
followed by C:\Users\User\AppData\Local\darktable>sqlite3 fixedlib.db <libs.sql
And did the same for the data.db file and it’s a case of so far so good - DT started, and my recent edits and ratings seem all intact.
Thanks very much! And @Till80 thanks too - I’m considering increasing the frequency of those auto-backups.
I would consider using the xmp plus backup.
Yes… I just don’t like the flurry of xmps in my folders…
You can increase the frequency of backups:
Mark them as hidden files
I think I’ll do that.
@priort I was wondering about that…