Hi, I’m trying to recover a corrupted Anki collection on macOS and I’m hoping there may still be a way to salvage my recent cards/review history.
I had been seeing the message table had usn=-1: revlog for roughly at least over a week (I’m not sure exactly how long), but Anki continued to open normally and my cards/edits were still present. Every time I exited out of Anki, it would say the file is corrupt and I’ve attached the picture below. I kept ignoring it but now I think I need to do something about it.
I also then tried to sync and received an error saying my upload was corrupt and to run Check Database.
Running Tools → Check Database gave:
Collection file is corrupt. Please restore from an automatic backup.
My current collection still opens and shows my decks, including recent edits to AnKing cards and recent study progress, but attempts to export now fail with:
DatabaseCorrupt ... database disk image is malformed
I stopped trying to sync it, and I made a full copy of the profile before attempting repairs. But I’m afraid maybe the copies I made are also corrupt too. I don’t remember how long it’s been corrupt for.
Things I have already tried:
- Updated Anki from 25.09.4 to 26.09
- Made a full copy of the
User 1profile before repair attempts - Manual
.colpkgexport — Anki reports it is not a valid package when imported - Automatic
.colpkgbackups — multiple backups also report as invalid sqlite3 collection.anki2 .dump > dump.txt- dump ended with
ROLLBACK; -- due to errors - changing this to
COMMIT;and rebuilding produced many errors, including missingsqlite_stat4,fields,templates,notetypes, anddecks
- dump ended with
- SQLite
.recover:sqlite3 collection.anki2 ".recover" > recovered.sql- rebuilt into a new database successfully at the SQLite level
- when Anki opened it, it failed with
no such table: decks
- Tried exporting a single deck as
.apkgwith scheduling information, but export failed with:DatabaseCorrupt ... database disk image is malformed
- My iPhone copy is older and does not contain my recent work
The current corrupted Mac collection is still readable enough that I can browse my decks and see recent edits/cards, but Anki cannot export or validate it.
Is there any Anki-specific recovery method that could salvage:
- recent note/card edits,
- recent review history/scheduling,
- or rows from the corrupted
collection.anki2
without reverting fully to an older copy?
I can provide the raw collection.anki2 file if needed. It is about 125 MB.
I’d appreciate any guidance on whether this collection is still recoverable and what files would be most useful. Thanks!
