MasterHowToLearn

MasterHowToLearn

How I Moved My 50,000-Card Anki Collection to SuperMemo

2018-08-15 2018-10-28 2020-12-26

Image by Lolame from Pixabay

If I’ve convinced you to switch to SuperMemo, then you are probably wondering,

How am I going to move my Anki collection to SuperMemo?

No worries. This post/guide can help you for a smoother transition.

2020-12-26 Update: This whole article is out-of-date and made obsolete (in a good way) with all the new tools. My good friend Raj has made a video on anki2sm: Transferring Decks from Anki to SuperMemo!. I suggest you watch the video and follow the instructions for a better transition than the following guide.

Quick Terminology Recap

SRS = Spaced Repetition Software

SM = SuperMemo from super-memo.com; NOT the courses, mobile app, application from supermemo.com. They are different.

Items in SuperMemo = Cards in Anki

IR = Incremental Reading

When I decided to move my Anki cards to SuperMemo, I didn’t know it would be so much trouble. Exporting from Anki was easy. The trouble was importing in a way that SM recognized. Processing the raw data was very time-consuming.

Googling didn’t help much. I couldn’t find useful results. All the information about SM was old; this blog helped but those articles were almost a decade old.

Such guide needs an update. There was no way I would give up my precious knowledge in Anki. Fortunately, my perseverance paid off. If you are switching over to SM with an Anki collection, I believe this guide can help you a lot.

PS: I’m sure there are better ways, but this is just how I do it.

Process

1. Export from Anki

2. Processing (cards with multimedia like mp3 and images OR clozed cards)

3. Import into SuperMemo

1. Exporting from Anki

I use the innate export function. Choose export format: “Notes in Plain Text”. Do not use “Cards in Plain Text” because your cards will not be tab-separated according to the fields in Anki.

note_export

There are addons for enhanced export functions. I didn’t use them. But if you have specific needs, they may be helpful.

2. Processing

I. Mass Import Basic Q&A Cards

II. Mass Import Clozes

III. Mass Import Multi-media (vocabulary) Cards

I. Mass Import Basic Q&A Cards

The basic import format into SuperMemo is Q&A

SM supports importing with HTML tags. This helps retain your original Anki card style.

II. Mass Import Clozes

Anki cloze to SuperMemo Item converter

This is a tool made by a SuperMemo user. This script is extremely helpful: it automates the task of converting clozes in Anki format to SuperMemo format. Super handy. I had THOUSANDS of clozes in Anki format and there’s no way I would do it manually.

converter_result

You just need to paste the results to a text editor, e.g., notepad.

In SuperMemo:

File > Import > Q&A text

After that, your cards (items) should appear in the Knowledge Tree.

III. Mass Import Multi-media (vocabulary) Cards

If you’re exporting vocabulary cards with images and mp3 files, it’s a bit tricky, more so if it’s an Asian language.

I think this solution is inferior because the images and mp3 files will bypass the sound and image registry. And… well, the mp3 player is ugly.

So we will use the XML import.

tl;dr: Here’s the solution from supermemopedia.com

Data Processing in Excel

After exporting with the export format: “Notes in Plain Text”,

1. Open a blank Excel document

2. Data tab > From Text > Choose the exported txt file

3. The Text Import Wizard should pop up. If it’s an Asian language, it probably couldn’t be displayed properly. Under file origin, choose 65001: Unicode (UTF-8). Your target language should now be readable under the preview tab.

Update: For Office 365 Excel users, you have to enable the Text Import Wizard: PublishedDate: For Office 365 Excel users, you have to enable the Text Import Wizard: cover:

Click File > Options > Data. Under Show legacy data import wizards, select From Text (Legacy).

Once enabled, go to the Data tab > Get & Transform Data > Get Data > Legacy Wizards > From Text (Legacy). Then, in the Import Text File dialog box, double-click the text file that you want to import, and the Text Import Wizard will open.

vocabulary_1

4. This is the result. Each tab represents each card field in Anki:

vocab_2

field-explanation

As you can see, there are a lot of HTML tags. I use the Find and Replace function (Control + F) to remove them. I don’t remove the <b> tag because I need them to bold the target vocabulary in SM. So I usually just remove all the <div> tags.

Now, this is much more readable.

vocab_3

SuperMemo only supports two fields: Question and Answer. So if you have more than one answer field in Anki, you’d need to concatenate all your answer fields into one in Excel.

In my example, column B and C belong to the answer field: Column B is the English translation and column C is the explanation.

I use the CONCATENATE formula to string column B and C together.

Retaining Text Styles

This is how I retain text styles from Anki. I’m no expert in Excel so I had to resort to using such dumb methods to retain the text style from Anki. I’m sure they are more clever ways to do this.

I use the website wordtohtml to test how the HTML codes are displayed.

concatenation

Step 1:

Column A has the desired font size and font family.

Column B has the original sentences with the HTML tag for bolded words.

Column C has the </span> end tag

Step 2:

I use the formula =CONCATENATE(A3,B3,C3) to combine all three fields together.

After concatenation, in a new column, copy and paste with Paste Special: Values from the concatenated field.

Step 3:

I use this HTML Character Encoder to encode all the Korean characters into HTML. If I don’t, they will become ??????? in SM. I guess this step is only needed for Asian characters.

Absolute Path for Multimedia

I copied my collection.media folder from Anki to another location. This is the sound field exported from Anki. For the absolute path for every mp3:

1. Remove all the [sound: and ] with Find and Replace

2. String them together with concatenation.

string

Generating the XML

Then, with all the raw data ready, you can generate them into the XML format. I suggest you try a few before doing in batch, like 500 cards. Make sure you get the format and style right before mass processing.

I followed this website on how to generate XML with the SM template.

Here’s the XML template you may consider using:

Refers to this solution from supermemopedia.com for the properly formatted XML template.

template

If you don’t have an mp3 file or image for that item, then just leave it blank.

If you don’t have any mp3/image file for your whole deck/collection, then simply delete the following session(s):

template_sound

PS: If the above template doesn’t work; you can export a working template from SM and use it.

With a Working XML Template:

1. Developer Tab → Source → XML Maps → Add → XML template

Then a prompt will show up. Just click OK. Also, no need to use “Verify Map for Export”. Even my working template encounters problems with “Verify Map for Export”.

prompt1

If you see your XML map appears, click OK

clickok1

2. Drag the top element to A1:

draga11

3. After dragging, click “Refresh Data” to check the validity of your XML template. If A2 has the proper names, then it’s working.

refresh1

4. This is the result. Delete all the A2 row data; copy and paste your own data to the columns.

refreshed1

This is the result:

xml-result

Now brace yourself and try to import this .xml file into SuperMemo by:

File > Import > XML import

sm-result

Target words bolded. Check.

Answer field with translation and grammr point. Check.

Audio. Check.

And you’re done!

Review History

What about all my previous review history in Anki? How do I export it to SuperMemo?

In the SuperMemo Google forum, there is a post called “Converting Anki deck to SM with Repetition History”

I didn’t follow it. So all my review history and schedules were gone. I started from zero.

First, I doubt the validity of the method. I was terrified of messing up the review schedule (since day 1 of using Anki). I was given to understand that SM-17 deals with the data differently:

From ”Algorithm SM-17 vs. older SuperMemos“,

Older SuperMemos do not consider the R dimension”. The difference is that SM17 uses the DSR model of memory, whereas SM2 uses the DS model. Such fundamental difference makes it unlikely that the data (card history) from Anki can be (correctly) transferred to SM17.

So I opted to start from ground zero. If you don’t want to lose all your scheduling records from Anki, you may follow what OP did for his Anki data.

Closing Remarks

It took me more than 2 weeks (and a lot of procrastination) to figure these details out. Hopefully this is helpful and can ease your pain of the transition.