"Import any learning progress" doesn't work

Steps to reproduce

  1. Create a deck with a single basic card.
  2. Export the deck with scheduling information.
  3. Create a new profile.
  4. Import the deck into this new profile.
  5. Review the card.
  6. Export the reviewed deck with scheduling information.
  7. Import this last deck into the first profile with “Import any learning progress” enabled.

Expected behavior

The review is transfered and the card is no longer new.

Actual behavior

The import “skips” the note.

Other quirks

Edit: what's in this `details` is wrong

Importing the deck to the new profile renamed the note type to Basic+. I guess this makes sense, but what doesn’t make sense is that when importing the reviewed deck back into the first profile, the note type is renamed to Basic++, instead of just using either the old or the new name.

[I understand that the note type in the exported deck has the same ID as the Basic note type in the first profile.]

If you edit the contents of the note in the second profile, then importing it into the first profile will include the edits, but not the review!

Additional info

I’ve tested this on Anki Desktop 25.09.4 and AnkiDroid 2.24.0. I also tried all sorts of combinations of the import options, editing the note, reviewing first, and more.

The only way that the reviews get imported is by deleting the notes in the first profile before importing.

Questions

  • Is this the intended behavior? It sounds completely wrong to me.
  • If this is intended, then what is the proper way of importing learning progress into a deck? Deleting notes is risky since maybe not all of them are in the to-be-imported deck.

Edit: duplicate posts

I found some posts from the Related topics below, that basically have the same problem:

When you created a new profile, that created a new default “Basic” note type. The notes made with your original profile’s “Basic” note type aren’t identical, so the new profile creates a new note type on import.

When you import this back into your original profile, the note type now doesn’t match because you’ve changed the name, so again, the profile creates a new note type.

You don’t mention what import options you chose for updating and merging, but that would be the first place to look for ways to deal with this process.

As far as your specific sequence of steps – what’s the use case for this?

If you have the deck with learning progress, that’s all you need. You don’t need another older, unused version of the deck.

If the unused version of the deck is newer, and you want to use it to update your existing notes and add any new notes, you should start with your active deck. Import the updated version into that – using the appropriate import options to update or skip notes as needed.

See also:

I understand why the Basic note type is renamed to Basic+, as I said, “I guess this makes sense”.

Does it create a new note type? Because the Basic note type in the first profile disappears and all notes that were Basic (including un-exported ones) turn into Basic++, suggesting that Anki renamed the note type to Basic++, instead of either Basic or Basic+ (which would be more sensible).

I can’t check the note type ID, but I believe the note I created then exported and imported back still has the same note type ID, just under different names.

As I said:

That includes toggling the merge note type option, choosing the various update notes/note types options (specifically “Always” and “If newer”) and in many combinations.

I undid the import each time to make sure it’s not skipping because of previous imports. I also tried checking the database, renaming the note type to Basic before importing back to the first profile (which didn’t result in a Basic+ or Basic++ note type, further supporting my claim above), editing the note’s text then reviewing, and even tested with more than one note (one review and one new) to see if it only affects new cards.

Conclusion: learning progress is not imported unless you delete the notes in the first profile before importing.

I’m trying to split one of my decks into 3 profiles (technically, using AnkiDroid’s parallel apks) for… umm… “testing purposes”. I’d like to keep all the cards in my original profile with the ones in the other profiles suspended. Then every once in a while, I import the decks from the other profiles to have combined stats.

Well, you can’t use import to change the review history, period.


I understand that it’s a very niche use case and there’s already the workaround of deleting the notes, but if this is not the intended behavior, then I hope it’ll be changed in the future to make more sense.

It looks like the section of the manual about merging conflicts suggests using the import deck feature.

Given the above, wouldn’t that not merge both collections if the user has done reviews on both devices?

Edit: to be fair, the manual doesn’t mention merging reviews.

You’d have to check your database to be sure. The ID is just the creation timestamp, so that would tell you for sure whether it’s a new note type or a renamed note type. I suspect it’s new.

[I’m sure you could search up instructions for how to query the DB from the Debug Console, but I’ve never gotten comfortable with that, so I tend to use SQLite Browser when I want to look at something – see: Statistics - Anki Manual. It’s safest to make a copy of your database and look at that, not your original.]

Sorry, yes – I missed that. You should have gotten different results with those different options though. If some of the import options are doing the wrong things, we’d need specific information about that, so a dev could take a look.

So, not a typical-user case!:wink:

If you want to maintain the integrity of your collection, a COLPKG export/import would probably be more effective for you.

Right, but you’re responding to the case where “the unused version of the deck is newer , and you want to use it to update your existing notes and add any new notes.”

You’re right that the manual is targeting separate collections with separate decks and notes. But if someone is studying the same decks/cards in multiple collections, a merged review history would be a muddled mess. Probably better to advise them to pick one review history, and simply stop using the other collection.

The only one that’s not working as expected is “Import any learning progress”.

In fact, what I said initially about `Basic++` was due to an oversight

I noticed a “bug” in AnkiDroid where it said that I need to use the merge note types option… long story short, I couldn’t reproduce it, but I discovered that the thing I said initially about Basic++ was because I already had a Basic+ note type.

So, I did lots of testing (steps below) and here’s what I noticed:

  • The note type ID is preserved in .apkg files and it is what Anki uses to tell note types apart.
  • When importing, if there is an existing note type with the same name, but a different ID, the imported note type’s name gets modified (+ is appended to it, from my testing).
  • When importing, if there’s a note type with the same ID but different names, Anki seems to pick the newest name, and if that name is taken, Anki adds a + to it.
  • In all cases, the ID stays the same.
Steps I used to test. No one needs to read this!
  1. Make two completely new profiles. For AnkiDroid, use two new “AnkiDroid directories”.
  2. Create a deck in the first profile and two Basic cards to it “review” and “new”.
  3. Rate the “review” card “Easy”.
  4. Export the deck with only the scheduling information checkbox checked.
  5. Write down the Basic note type’s ID somewhere (I used the Advanced Browser addon). I did nothing for AnkiDroid.
  6. Switch to the second profile.
  7. Import the deck with scheduling information. Leave the other options at the defaults.
  8. Observe that the note type is Basic+ and its ID is the same as the original Basic one. The second collection also has a Basic note type with a different ID (which you can check by adding a card, but undo afterwards).
  9. Rate the “new” card “Again” and use “Grade now” to rate the “review” card “Again” too.
  10. Export the deck with only the scheduling information checkbox checked.
  11. Switch to the first profile.
  12. Import the deck with scheduling information. Leave the other options at the defaults.
  13. Observe that the notes are skipped but the Basic note type is renamed to Basic+ (same ID, and there is no Basic note type anymore).
  14. Undo the import.
  15. Import the deck again, but this time, enable everything and choose “Always”.
  16. Observe the same result as before.
  17. Switch to the second profile.
  18. Edit the text of both notes then rate them “Good” for good measure.
  19. Export the deck with only the scheduling information checkbox checked.
  20. Switch to the first profile.
  21. Import the deck with scheduling information. Leave the other options at the defaults.
  22. Observe that the note texts are updated and the Basic note type is renamed to Basic+ (same ID, and there is no Basic note type anymore).
  23. Undo the import.
  24. Import again with all options enabled/set to “Always”.
  25. Observe the same behavior as last import.
  26. Undo the import.
  27. Add a Basic note type named Basic+ (which has a different ID as you can verify).
  28. Try to import again with scheduling information. Leave the other options at the defaults.
  29. Observe that the original Basic note type is renamed to Basic++ (same ID, and there is no Basic note type anymore). The text is updated, but the history is not included.
  30. Undo the import.
  31. Try again with all the option enabled/set to “Always”.
  32. Observe the same behavior as last import.
  33. Switch to the second profile.
  34. Delete the Basic note type and rename the Basic+ note type to Basic.
  35. Export the deck with only the scheduling information checkbox checked.
  36. Switch to the first profile.
  37. Import the deck with scheduling information. Leave the other options at the defaults.
  38. Observe that the note type is Basic as expected, the notes’ text is updated, but no history is included.
  39. Undo the import.
  40. Try again with all the option enabled/set to “Always”.
  41. Observe the same behavior as last import.
  42. Check data base.
  43. Observe the same behavior.
  44. Restart the app.
  45. Observe the same behavior.
  46. Check database again.
  47. Observe the same behavior.

How? .colpkg files replace everything (except app settings) so I can’t see how it can be used for my use case.

Yeah, I misunderstood that part.

I worded that poorly. I meant if a user has used the same collection on two devices and forgot to sync, as in this recent Reddit post, the reviews done on the device from which we export .apkg files won’t be included except for cards that weren’t in the other device.