Deck Errors
Restoring from backup
Anki makes an automatic backup every time you open the deck, and if you are using the synchronization features, there'll be an online copy too.
Either download the online copy with File>Download>Personal Deck, or use Settings>Preferences>Saving>Open backup folder.
Before opening a backup file:
Copy the file, so you don't accidentally damage the backup
Go to Settings>Preferences>Network and turn off sync on open & sync on close until you determine the backup is what you want.
Attempting to fix the corruption
If your backups are also corrupt (which won't happen with the latest version, but could have happened with previous versions of Anki), or if you did a lot of work since the last backup, then you can attempt to recover your broken file.
On Linux, make sure sqlite3 is installed. On a Mac, it should be installed already. On Windows, download http://www.sqlite.org/sqlite-3_6_23.zip
Linux and OSX
In a terminal, type:
sqlite3 yourdeck.anki .dump | sqlite3 newdeck.anki
Make sure you use a different name for the new deck. Then open the new deck in Anki and run a full DB check.
Windows
Copy the sqlite3.exe program and your deck to your desktop. Rename your deck to something simple with no spaces or other foreign characters - for example, mydeck.anki. Then go Start>Run and type in cmd.exe.
If you're on a recent Windows, the command prompt may not start on your desktop. If you don't see desktop displayed in the command prompt, type something like the following, replacing 'administrator' with your login name.
cd C:\Users\Administrator\Desktop
Then type:
sqlite3 yourdeck.anki .dump | sqlite3 newdeck.anki
Make sure you use a different name for the new deck. Then open the new deck in Anki and run a full DB check.
Causes
If you receive the message "File is corrupt or not an Anki database", the following things are possible:
Database is corrupt
Possible reasons:
- You move or renamed the deck while Anki was running
- Your hard drive or USB stick has errors
- You're using Linux and an older version of sqlite that is not properly locking the deck.
You'll need to restore from backup (as described above).
Upgrading failed
- You upgraded to a newer version of Anki and the automatic upgrade did not go smoothly
This is usually an easy fix - please post about in on the forum and include the error message.
You're trying to open an old deck created with Anki < 0.4.x.
You need to download Anki 0.9.7.8, open the deck with that, and then open the deck with the latest version. You can install 0.9.7.8 in a different directory and use it just for upgrade purposes.
Other
- Your disk is full
- The files are read only
In this case, free up space or store the files in a writable location.
Please note that while Anki takes regular backups, it's a very good idea to make your own backups in case of emergency. Also, your audio and pictures are not backed up, so you need to take your own backups of them.
