All media is deleted

Hi everyone,

I accidentally tried to rearrange the note type of my cards in Anki Desktop, and afterwards the field that previously contained my images is now empty.

The important thing is that I have already created and updated many new cards since then, so I absolutely do not want to restore an old backup and lose those new cards.

I checked Tools → Check Media, and Anki reports:

“The following files are referenced by cards, but could not be found in the media folder.”

However, I believe the original image files may still exist somewhere in my Anki Desktop folder. I did not intentionally delete the images or the notes — I only changed the note type. I also didn’t find any medias in the bin of my computer.

Any help would be greatly appreciated!

That is the section about “Missing” files, which doesn’t sound like it would apply to your situation. Does it also report that you have “Unused” files? If so, those files are still in your collection.

If you deleted that field from your note type, that would delete all of those references to your files in those fields. The references would remain lost even if you later re-added the field to your note type.

  • Is that what you did? Or did you use Change Note Type to switch these notes to use a different note type? The methods available to restore are different depending on what you did.
  • Do you know approximately when you made that change?

Thank you for your reply!

You are right, majority of the files have the tag “unused” in front of them.

I m pretty sure that I wanted to change the order of the fields and must have accidentally clicked “media“ → “(nothing)” . I didn’t noticed it until I made some reviews and all media was missing. So a bit of time passed and it happened on the 28th September.

That sounds like you used Change Note Type, but changed to the same note type – is that right? [For future reference – when all you’re doing is changing the order of fields, you can use Manage Note Types > Fields > Reposition for that, and not take this risk of losing data.]

How serious were the changes? Did you change the order of other fields and/or rename fields? Did you change the first field? Did you add new fields?

Restoring from a backup would generally work well for this [done in a slightly different way to preserve the rest of your data] – but if there have been major changes to the structure of your note type, or you changed to a completely different note type than these notes used before, it might not be possible.

Thank you for that great tipp!

I downloaded a new deck from our uni website. It had the same note type as my other decks but I noticed, that the website from which I downloaded the cards had a wrong order and the context didn’t match the field in which it was written. For example text was written in the photo field.

So I just wanted to change the order of the fields and match the fields with the content again. But as I did that at one step I must have clicked photo → (nothing). I thought it just changed the few cards I selected but a few days later I noticed all of the photos were missing. So to sum up, I didn’t add new fields or deleted them, more like a crossover between the existing fields.

I hoped the situation got a bit clearer. :slight_smile:

It sounds like you weren’t changing the fields of the note type at all, you just wanted to swap the information in one field of those notes with the information in another field of those notes.

In that case, this should work fine.

  1. Create a fresh (temporary) profile in desktop Anki.

  2. Go to your Anki2 data folder for your main profile, and find the automatic backups – they’ll be in a folder inside your profile folder, so something like User1/backups. Find the most recent backup that you think has correct info in those fields.

  3. Import that COLPKG into your temporary profile. Find the deck and make sure it has the media references. [The images won’t appear, because they aren’t part of this backup (or this profile), but if you click < > above the field, you’ll see the reference to the image.]

  4. Export just that deck, as APKG, all boxes unchecked.

  5. In your main profile, make a fresh backup (just in case) – File > Create Backup.

  6. Import that new APKG, and in the options select Update notes: Always.

  7. If you’re not happy with the result, Edit > Undo or restore the backup you made at #5.

  8. Once everything is settled, delete the temporary profile you made.

Thank you very much, it worked for me!

Great!

Your final step should be to get rid of the unused media that is still hanging around in your collection. You’ve got over 12 GB of media in your account, and if that’s not all still necessary, then you’ll save yourself, your device, and the servers the trouble of keeping those in sync everywhere.

Run Tools > Check Media > Delete Unused Media. At this first step, the files will just be moved to another folder, so it’s completely safe and reversible. Syncing after that will delete those files from the server and your other devices. You can wait until you’re confident that was media you didn’t need before going back to run the second step, Empty Trash.