{"slug": "anki-migrate-english-notes-to-tts-note-types", "title": "anki: migrate English notes to TTS note types", "summary": "A developer migrated 1,089 English notes in Anki to dedicated note types with British English text-to-speech, removing 7 reverse cards and preserving all review data, using Anki's Python package after AnkiConnect lacked a changeNoteType action. The migration, rehearsed on a database copy, resulted in 1,086 language notes and 3 cloze notes, with integrity check passing and a successful AnkiWeb sync.", "body_md": "♠ [Previously](https://perrotta.dev/2026/04/anki-flashcard-generation-with-claude-code/).\n\n**Problem statement**: migrate my English 🇬🇧 deck to dedicated note types with\nBritish English text-to-speech, without adding reverse cards.\n\nI created `English Language Card 🇬🇧`\n\nwith four fields (`Front`\n\n, `Front Example`\n\n,\n`Back`\n\n, and `Striked`\n\n) and only one card template:\n\n```\n{{Front}} {{tts en_GB:Front}}\n\n{{#Front Example}}\n<br>\n<i>{{Front Example}}</i> {{tts en_GB:Front Example}}\n{{/Front Example}}\n```\n\n`English Grammatik Cloze 🇬🇧`\n\nuses the same TTS setup for cloze notes:\n\n```\n{{cloze:Text}} {{tts en_GB:Text}}\n```\n\nAnkiConnect could create both types, but did not expose a `changeNoteType`\n\naction. I closed Anki and used its own Python package instead. Before changing\nthe collection, I exported the English deck and copied the SQLite database:\n\n```\n4.8M pre-english-note-type-migration-2026-08-22-13.27.44.apkg\n9.9M pre-english-note-type-migration-2026-08-22-13.29.08.collection.anki2\n```\n\nThe field and template maps did the migration in place:\n\n```\ncol.models.change(basic, groups[\"Basic\"], language, {0: 0, 1: 2}, {0: 0})\ncol.models.change(cloze, groups[\"Cloze\"], english_cloze, {0: 0, 1: 1}, None)\n```\n\nI rehearsed the migration against the database copy before running it for real:\n\n```\n% PYTHONPATH=/Applications/Anki.app/Contents/Resources/app_packages \\\n  /opt/homebrew/bin/python3.13 /tmp/anki_migrate_english.py \\\n  ~/Library/Application\\ Support/Anki2/User\\ 1/collection.anki2\n{\n  \"notes\": 1089,\n  \"cards_before\": 1096,\n  \"cards_after\": 1089,\n  \"language_notes\": 1086,\n  \"cloze_notes\": 3,\n  \"removed_reverse_cards\": 7,\n  \"integrity\": \"ok\"\n}\n```\n\nThe script also checked every mapped field, retained card ID, and review-log count. After a full upload to AnkiWeb, a normal sync passed.\n\nNo reverse cards, and all English notes can now speak for themselves (pun intended!).\n\n🤖 *Drafted with * ∎\n\n`/bloggify`\n\n.— § —\n\nReply via [email](mailto:serendipity@perrotta.dev?subject=Reply to: anki: migrate English notes to TTS note types)", "url": "https://wpnews.pro/news/anki-migrate-english-notes-to-tts-note-types", "canonical_source": "https://perrotta.dev/2026/08/anki-migrate-english-notes-to-tts-note-types/", "published_at": "2026-08-22 11:36:25+00:00", "updated_at": "2026-08-22 22:13:56.160432+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Anki", "AnkiConnect", "AnkiWeb"], "alternates": {"html": "https://wpnews.pro/news/anki-migrate-english-notes-to-tts-note-types", "markdown": "https://wpnews.pro/news/anki-migrate-english-notes-to-tts-note-types.md", "text": "https://wpnews.pro/news/anki-migrate-english-notes-to-tts-note-types.txt", "jsonld": "https://wpnews.pro/news/anki-migrate-english-notes-to-tts-note-types.jsonld"}}