Why have I lost all of my cards (~1600) after syncing today?

Today when I opened up the app (on my laptop under Linux, but also on my Android phone and on my tablet) I saw a note telling me that my collection was empty!

Yesterday I did a repetition session and synced it back to your servers and now I see nothing there.

I managed to export my data from a phone, first disabling Internet connectivity, but about 30 notes is gone.

Why has this happened to me? I can see the Tags are there (only on PC and phone, not on a tablet), but nothing else.

Do you have everything restored? All of your devices make frequent local backups, so restoring from the most recent one of those is the best way to get back everything you lost. Restoring an Automatic Backup (Recovering from Data Loss) - Anki FAQs

As for why it happened, the most likely reasons for a completely empty collection are -

  • Opening the wrong profile – a new, blank profile instead of your regular one. This can happen on a single device if your collection is stored in a location that becomes inaccessible. Anki would then create a completely new profile in a stable location. But there’s no way that would sync to other devices unless you set up syncing and did that.
  • Doing a one-way sync in the wrong direction.
  • Your database failed completely – exceedingly rare, but not impossible, I suppose. Again, this couldn’t spread to other devices without you syncing.

I wish you could give us more specifics about what the message said. Having the exact error message is the easiest way to track things like this.

Thank You for your reply, I did restore from a backup from yesterday, now everything seems OK.

I did not get any notification, just a blank page, like I have just started this app for the first time.

I did not have any other profile so we can cross that out.

I only sync with this exposed button on top of the interface (two arrows in a circle), so the second option can be also dismissed.

I do not think anything wrong has happened on my side, just did a regular session like for the past year or so.

I don’t think there’s any way of knowing exactly what happened without knowing what the notification you got was. But I’m glad you were able to restore everything. Make sure you are fully synced on all devices.

And if I did not get any notification at all then what might be the cause?

You said that you did.

OK, my bad, it was not a pop-up notification, it was a phrase in the background of the main menu.

I got a little bit scared when I found my collection empty and just needed help, didn’t pay too much attention to how I articulated it.

Got it. Since you were able to recover from your local backup, and your data wasn’t actually gone – it seems likely that either you were looking at a different profile that Anki created for you, or you had a one-way sync that went the wrong way.

Have you looked to see if there is another unexpected profile in your system? You can check File > Switch Profile and/or look in your Anki2 data folder (each profile is its own folder). If you find one, it’s probably best to delete that.

The next thing to check – especially if you’re not using the default storage location – would be to search your system to make sure there isn’t another Anki2 folder that Anki was trying to use.

Other than that – run Check Database, to make sure your collection is healthy, and make sure your devices are all properly synced, so you’ll have multiple places you can recover from.

Thank You for this info.

Probably it was “a one-way sync that went the wrong way”, since I did not have any other profile at that time.

Recently I have created a second, empty profile. When I try to switch to that empty profile (all devices synced to DB) from my Android devices, I can not find a way to do it. Is that option to switch hidden somewhere, or it is how it’s supposed to be? Maybe I can only switch to a non-empty profile? Or am I simply blind :D?

Two issues there –

  • You can’t sync multiple profiles through a single AnkiWeb account. (Which is one of the reasons that multiple profiles aren’t generally recommended for a single user – https://docs.ankiweb.net/profiles.html.)
  • AnkiDroid doesn’t have built-in support for multiple profiles. (There’s a workaround, but it’s rarely needed.)

If you created that 2nd profile on your computer, then that’s the only place it exists.

Thanks, that is good to know.

If it was possible to export each deck separately, I wouldn’t even consider other profiles.

But it appears that if you export, you can only export everything at once.

Eh, I’ve found it, you can export each deck separately, but it is from that little ratchet next to deck name, a little unintuitive, but functional.

In desktop Anki? You can choose Export there, or from File > Export in the main screen, or from Notes > Export Notes in the Browse window. They all take you to the same place, and the only way that is limited to the entire collection is the COLPKG export. If you choose anything else, you can select how much of your collection to export. Exporting - Anki Manual

Thanks again, I am just a casual user of this very helpful application :slight_smile: