Lost fields after backup

Hello, I would like to understand why Anki automatically creates several note types after making a backup and syncing.

All of my notes were originally in the “Basic” note type, which had 3 fields:

Front

Back

Image

I synced with AnkiWeb, uninstalled AnkiDroid, and then installed it again.

When I synced again to restore my decks, my notes appeared in several different note types:

Basic

Basic+

Basic_

Basic___

And my third field disappeared completely.

After that, I tried to manually recreate the third field in those note types (since they no longer had it), but the data did not come back. Everything that was in the third field was lost.

I also did a manual test: I took a note with 3 fields and changed it to a note type with only 2 fields.

The result was that the third field disappeared. I tried recreating the third field, but none of my data came back.

I do not understand why, after syncing and making backups, Anki creates these “types” by itself. Is there any way to prevent this?

I did not do anything wrong. I mean, I did not create these “types,” and I did not use shared decks — only my own decks that I created myself. Since the first time I used AnkiDroid, everything had always been in the Basic note type with 3 fields, and then the first time I did this, this problem happened.

This is dangerous for people who have notes with more than 2 fields (FRONT and BACK), because Anki suddenly creates a note type with only two fields.


Can you clarify some details?

[1] Your title is about “after backup” and you start out talking about “making a backup and syncing” – but then you don’t mention making or restoring a backup later on. It matters whether you’re exporting/importing a “backup” – or whether this has to do with a first-time AnkiWeb sync on a fresh install. You shouldn’t be losing your data either way, but we should focus on the problem you’re actually having.

[2] I can see the AnkiWeb account associated with the email address you used to post here, but it was just created today, it’s empty, and it has no history of syncing with any of the apps. Please add the address for the AnkiWeb account you’re actually using to your account here in the forums (as a secondary/alternate email address), so I check on it.

Hello, thank you for your reply.

I think I explained myself incorrectly before.

I did not restore my collection through AnkiWeb synchronization.

What I actually did was:

I exported my decks as an .apkg file. I uninstalled AnkiDroid. I installed AnkiDroid again. I imported the .apkg file.

After the import, Anki automatically created several note types such as:

Basic Basic+ Basic_ Basic___

Originally, all of my notes were in a single “Basic” note type with 3 fields:

Front Back Image

After the import, my collection was split between several different note types, which now had only 2 fields, and the third field disappeared completely.

I did not manually create those extra note types, and I did not use shared decks.

I would like to understand why importing the .apkg file caused Anki to create multiple versions of the Basic note type and remove the third field.

I would also like to understand something else:

Is there any technical difference between this happening through AnkiWeb synchronization and through importing an .apkg file?

Thanks for clarifying! That makes a lot more sense.

When you did a fresh install of AnkiDroid, it created a new collection, which includes newly created versions of the default note types – like “Basic.” Even though that note type is the same as the default you had before, it was just created, so it has a new ID (based on its timestamp)

That APKG includes your notes and their note types (among other things). When you import a note type, Anki doesn’t just assume that note types with the same name are identical. Since you already had a default “Basic” note type in your newly created collection, and it had a new ID, so it definitely didn’t match any of the ones in the APKG – Anki protected all of the note types by giving them unique names. See: Removing duplicate note types - Anki FAQs .

Exactly what you end up with during the import depends on your import options – and I don’t know what you chose. For instance, if you told Anki to “merge” note types, that would create even more note types that were combinations of the one that existed and the ones you were importing.

But you still shouldn’t have lost any data. Now that you know where all those extra note types came from, you should check each of them. Which ones aren’t used (0 notes)? For the ones that are used, exactly what fields does each of those note types have? For the notes that were imported, which note type are they using? You can also run 3-dots menu > Check > Check Database to make sure everything is indexing correctly in your new collection.

If you still see issues, it’s probably best to start over with a fresh collection – either (A) use Android settings to delete the user data for AnkiDroid (probably the cleanest option), or (B) delete all notes and imported note types (leave the default ones). Then you can import your APKG file again, and be very careful about what options you select. The APKG is unchanged from when you created it.

Yes, there are several differences between importing an APKG, importing a COLPKG, and downloading an existing collection in a one-way AnkiWeb sync.

But since you chose APKG export, and then you deleted your collection (when you uninstalled the app), and it sounds like you didn’t have it synced to AnkiWeb/another device – this is the only version of your collection that you have to choose from. If you made a mistake creating that export (like by not including media, scheduling, or deck presets), there’s no way to correct that now.

I didn’t fully understand it, but did this whole problem happen because of the note type name “Basic”, which is AnkiDroid’s default note type name?

I mean, AnkiDroid always creates a note type called “Basic” by default as soon as it is installed. Since my exported file also uses the name “Basic”, the two conflict during import, creating copies (“Basic+”, “Basic_”) and causing my image field to disappear.

If I want to avoid this in the future, would the ideal solution be to rename my note type to something unique (for example, “MyPersonalModel”) before exporting the file? That way Anki wouldn’t try to merge it with its own default model, right?

Yes, that’s why that happens. (Plus, your import options.)

No, you shouldn’t lose any data regardless.

I still don’t think we’ve found what the issue was, so I’m not prepared to advise you on how to avoid this. What you’re reporting (loss of fields/data) shouldn’t happen. But until you check and try the things I suggested, we’re not going to be able to figure out how you got here.

Are you the same person who started this thread, and you just changed Forum accounts partway through? I don’t see an AnkiWeb account with syncing activity for either of these email addresses, so I can’t look at your current collection myself through our support portal.

Sorry for the delay in replying, Danika. I was doing some tests before coming here.

First, I did what you said: I cleared Anki’s data and deleted all the fields that were there, so everything became empty. Then I imported my deck again, and the third field came back. So I concluded that the problem really was the note type name “Basic”.

So I still have this question:

If you import a deck that has the same note type name as one that already exists in the Anki app, but they do not have the same quantitys of fields, besides Anki creating additional note types, will it also remove the fields that do not exist in the other note type?

That seems dangerous. It should not work like that. If you import a deck that has 3 fields, then Anki should not automatically place it into a note type that only has 2 fields and delete the third one.

Note:

I did a manual test. I selected several notes that had 3 fields and moved them into a deck/note type with only 2 fields, and Anki itself warned that the third field would disappear.

No. If the note types are a match (which probably requires them to have the same note type ID, not just the same name), Anki will follow the import options you select to determine whether to merge with/update your existing note types. For more, see: Packaged Decks - Anki Manual and the :white_question_mark: tooltip in the import screen.