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:

  1. Copy the file, so you don't accidentally damage the backup

  2. 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'll need to restore from backup (as described above).

Upgrading failed

This is usually an easy fix - please post about in on the forum and include the error message.

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

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.

AnkiWiki: DeckErrors (last edited 2010-07-24 01:39:39 by DamienElmes)