Skip to content

Import & export

DecksMD imports an Anki .apkg export — your decks, cards, media, and scheduling + review history all come across, mapped onto FSRS-6 so cards resume where Anki left off rather than starting over. The import is additive and non-destructive: it writes into a target folder you choose (nested under the #decks/anki tag), never touches the source .apkg, and re-importing simply overwrites what it generated.

  1. In Anki — File → Export, format Anki Deck Package (.apkg), with Include media and Include scheduling information checked. Export a single deck or your whole collection.
  2. In Obsidian — open it from the import icon in the deck-panel toolbar (in the ”…” overflow menu on a narrow panel), or run the Import from Anki (.apkg) command.
  3. In the dialog, choose the .apkg, a target folder, and a profile (its header level and scheduling apply to the imported decks). Optionally Scan first for a preview of deck/card/media counts, then Import.

Your Anki note types map onto DecksMD formats automatically:

Anki stores cards as HTML; DecksMD stores markdown. The conversion covers the things that would otherwise arrive as mangled tags:

  • Formatting — bold, italics, lists and tables become markdown. <script> and <style> are dropped. Sub- and superscript survive as inline HTML, since markdown has no way to say them.
  • Media — [sound:…] and <img> become ![[embeds]], with the files copied across. Images carry a width hint taken from their real size, so a small image is not blown up. Images hosted elsewhere stay as plain links.
  • Maths — MathJax \(…\) becomes $…$ and \[…\] becomes $$…$$. Anki’s [latex] markup converts too.
  • Tags — notes are grouped by tag set, and each group gets its own heading carrying those tags, so your Anki tags end up as per-card tags.
  • Add-on syntax — [[…]] sequences left by add-ons are neutralised so Obsidian does not read them as broken wikilinks.

A big deck is split across numbered part-files rather than becoming one unopenable note — at 1,000 cards, or 500 media embeds, whichever comes first. A note is never split down the middle: cards are chunked by their note, so re-importing puts everything back in the same place and your history stays attached.

Worth knowing before you import a large shared deck:

  • Repeated cloze numbers. DecksMD takes cloze order from position in the text, so a note reusing {{c1::}} for several deletions becomes several cards rather than one card with several blanks.
  • Scripted templates. Some premium decks run a <script> in the card template to show one item from a field holding many. The script is stripped and the field kept, so those cards can come out verbose.
  • Unusual note types. Anything outside the types above falls back to a basic card built from the fields its template referenced; unreferenced fields become notes.
  • Long histories take a while. Review logs are written per card, so a very large collection is slower — bounded and progress-tracked, but not instant.

Coming from the legacy Spaced Repetition plugin? The migrator turns every legacy card into a DecksMD deck, rewrites your notes into clean readable prose, and carries the SM-2/FSRS scheduling into FSRS-6 with a review log per card, so reviews resume rather than restart.

Like the Anki import, it’s additive: output goes to a target folder you choose (mirroring your source structure), your original notes are never touched, and re-running overwrites the generated files. Migrated decks are grouped under the #decks/migration tag.

Run the Migrate from Spaced Repetition plugin command (or the migrator icon in the panel toolbar), choose a target folder and a profile, then migrate. Legacy reverse cards (Front ::: Back) become two cards, each direction scheduled independently.

Each source note is rewritten into readable prose rather than having its cards cut out of it. The inline syntax is replaced by what it meant:

  • :: and ::: become an em dash.
  • A ? separator joins the two halves into a sentence; ?? keeps the line break.
  • ==highlights== and {{curly}} clozes become the answer text they were hiding.

Code fences, maths and existing highlights are left alone, so nothing inside them is rewritten by accident. The result is a note you can actually read, sitting alongside a deck file that holds the cards — the two cross-linked in frontmatter.

A legacy Front ::: Back card becomes two plain cards in the same deck file, one per direction, and each keeps the history Spaced Repetition stored for it — the forward and reverse schedules are carried across separately rather than merged.

Legacy <!--SR:--> metadata is read whether it holds SM-2 or FSRS values, and both ISO and DD-MM-YYYY dates are understood (ambiguous ones are read day-first). A review log is written per card, so migrated cards show up already due on the date they were actually due.

The migration never renames or deletes your original files, so Obsidian never recomputes incoming links. Backups are taken as copies, and the new files are created alongside — which means every [[wikilink]] pointing at a migrated note still points where it did before.

DecksMD can export to Anki, so cards and progress you build in Obsidian aren’t locked in. This is useful for sharing decks or moving to another tool.

DecksMD keeps automatic backups of its database. You control how many to retain via the automatic backup count setting (see the Settings reference). Because your card content also lives in plain markdown notes, your vault’s own version history and sync provider give you a second layer of safety.