Recovering and Migrating SuperMemo98 Data: Step-by-Step Guide
This guide walks you through recovering SuperMemo98 (.SM) data from legacy backups, repairing damaged files, exporting content, and migrating it to modern spaced-repetition tools (Anki, SuperMemo 16+, or CSV). Follow the steps in order; assume Windows environment unless noted.
Important preparation
- Make a full copy of the original SuperMemo98 folder and any backup files. Work only on copies.
- Note file types: SuperMemo98 uses
.SM(collection),.KID(media/attachments), and sometimes.SMB/.TXTexports. If files are compressed (ZIP/7z), extract copies first. - Tools to have ready:
- 7-Zip or equivalent (for archives)
- A modern text editor (Notepad++, VS Code)
- SQLite browser (if converting to SQLite-based formats)
- Anki (desktop) and AnkiConnect (optional)
- SuperMemo newer version (if available) or SuperMemo Import utilities
- Export/conversion scripts (Python suggested) — examples provided below
1. Inspect and identify files
- Open the copied folder. Look for files with extensions:
.SM,.KID,.INF,.TXT,.MDB,.SMB. - Sort by date to find latest working backup.
- If multiple versions exist, pick the newest complete set (SM + KID directories).
2. Repair corrupted .SM files
Symptoms: SuperMemo98 fails to open collection, or shows errors.
- Open the
.SMfile in a hex editor or text editor (it may contain readable text). - Look for obvious truncation at the end (incomplete tag) or small non-text corruption.
- If you have a previous backup, open both and copy a matching header section (first 1–4 KB) from the healthy file into the corrupted file—only do this if formats look similar.
- Search for repeated or garbled blocks; try removing suspiciously duplicated segments (save as new file).
- If file is binary and repair fails, export readable fragments:
- Use a text editor to extract any readable UTF-8/ANSI text (questions/answers).
- Save extracted text as
.TXTfor later re-import.
Note: Binary repair is risky. Prefer extracting content rather than full repair if unsure.
3. Extract notes and media
Goal: Get question/answer pairs and associated media into reusable formats.
- If SuperMemo98 can open the file:
- Use SuperMemo’s export feature (File → Export) to create
.TXT,.HTML, or.CSVexports. Export fully (all fields, include IDs). - Export media files from KID folders; maintain filenames.
- Use SuperMemo’s export feature (File → Export) to create
- If SuperMemo won’t open:
- Search for
.TXTor.SMBexport files in backups and extract them. - If you extracted readable text from the binary, parse it into Q/A pairs using a text editor or script.
- For embedded media: scan the folder tree for common media types (.jpg, .png, .wav) and copy them into a media folder.
- Search for
4. Convert to migration-friendly formats
Choose target: Anki (recommended), SuperMemo newer versions, or generic CSV.
A. CSV (universal)
- Create a CSV with columns: Front, Back, Tags, Media.
- For each card, put front (question) and back (answer). For media, reference filenames likeor [sound:filename.mp3].
- Save CSV as UTF-8.
B. Anki
- Put media files into Anki’s media folder or import via Anki desktop (Tools → Import).
- Format CSV as Front;Back;Tags, and ensure media filenames match Anki media.
- In Anki desktop: File → Import → select CSV. Map fields properly and choose a deck.
- Optionally use AnkiConnect or Python (genanki library) to build decks programmatically.
C. SuperMemo newer versions
- If you have SuperMemo 15+ or 16, try direct import:
- Use SuperMemo import tools (File → Import) and choose TXT/CSV or HTML exports created earlier.
- For advanced conversions, use intermediary XML/HTML exports and follow SuperMemo import mappings.
5. Reattach media correctly
- Ensure media filenames in exported card backs/fronts match actual files.
- For Anki: place media files into Anki’s package or drag into card editor during import.
- For CSV imports that reference media, confirm import settings allow “media” and that files are placed in the same directory during import.
6. Validate and fix formatting
- Open a subset of imported cards in target app and confirm:
- Text encoding correct (UTF-8).
- Images/audio display and play.
- Special formatting (HTML tags) renders properly.
- Run batch fixes if necessary:
- Use search/replace to fix broken HTML.
- Use scripts to adjust image src paths or convert line breaks.
7. Preserve scheduling history (optional)
SuperMemo98’s SM algorithm stores review history and intervals. Most target tools will not accept SM’s exact scheduling data. Options:
- Export review dates as plain fields in CSV so you retain historical metadata.
- If migrating to newer SuperMemo versions that support importing history, follow their specific import schema (usually XML with timestamps).
- Otherwise, accept a fresh scheduling start in the new tool and use tags/fields to note prior review statistics.
8. Automate with scripts (example)
Use Python for bulk parsing and conversion. Example outline (pseudo):
- Read exported TXT/SM fragments
- Parse Q/A blocks with regex
- Save to CSV with media references
- Copy media to target folder
Minimal genanki snippet to create an Anki deck (save as createdeck.py and run):
python
from genanki import Deck, Note, Model, Package deck = Deck(2059400110, ‘SM98 Imported’) model = Model(1607392319, ‘Simple Model’, fields=[{‘name’:‘Front’},{‘name’:‘Back’}], templates=[{‘name’:‘Card 1’,‘qfmt’:’{{Front}}’,‘afmt’:’{{Front}}
{{Back}}’}]) # loop over parsed cards notes = [Note(model=model, fields=[‘Question 1’,‘Answer 1’])] for n in notes: deck.add_note(n) Package(deck).write_to_file(‘sm98_import.apkg’)
9. Final checklist before retiring backups
- Confirm all cards imported and media work.
- Keep original backup copies in offline storage for at least 6 months.
- Tag or note migrated cards with source “SuperMemo98” and migration date (e.g., 2026-02-07).
- Delete any intermediate files containing sensitive data if needed.
Quick troubleshooting
- No readable text in .SM: extract media, then rebuild cards manually from memory backups or screenshots.
- Duplicate cards after import: dedupe by front field in target app (Anki has add-ons; scripts can dedupe).
- Broken audio: re-encode to standard formats (MP3/WAV) and update filenames.
Example timeline (small collection, ~1k cards)
- 0.5–1 hr: Inspect files and make copies
- 1–2 hrs: Repair/extract content
- 1–2 hrs: Convert and import into Anki
- 0.5–1 hr: Validate, attach media, fix formatting
If you want, I can generate a Python script tailored to your exported TXT/SM fragments or create an Anki .apkg from a sample export you provide.
Leave a Reply