Migrating Decades of Blogger XML Archives into a Living Markdown Knowledge Graph in Obsidian
Nearly two decades of my writing was trapped behind web dashboards and forgotten cloud exports. Somewhere in there were weekend hardware experiments, old album photos, and stories I could not search from my own desk. Then I asked an AI model to draft a project summary, and it read like stiff corporate brochure copy that nobody who knows me would believe I wrote. If my writing tools were ever going to sound like me, everything I had published needed to live in plain local files that I own.
So I downloaded my Blogger backup and wrote a Python importer to turn it into notes. Blogger's XML export is one giant Atom file that mixes posts with blog settings, theme widgets, reader comments, and a lot of stray line-break markup, so the script keeps only the entries marked as posts. Each post becomes a Markdown note organized by year and month inside Obsidian, with its title, date, labels, and original permalink saved in the frontmatter. A manifest file maps every note to its live post ID and URL, which gives my automation a duplicate check for free.
The first full run felt like a small miracle. Opening Obsidian's graph view afterward was a little like watching old friends find each other at a long overdue reunion, because posts from 2008 about early home servers suddenly sat two links away from my 2026 Proxmox and Home Assistant notes. Having real context finally changed how my AI tools behave too, since my publishing agents could study years of my actual posts instead of guessing how I talk.
Of course, the first import came with a catch or two. Some of my oldest photos still pointed at legacy Picasa and blogspot image hosts that throttle requests or have already let go of the file, and the freshly imported notes sat in Obsidian like isolated islands because nothing linked them yet. I fixed the first with a small downloader that saves each image locally and rewrites the link to an Obsidian embed. I fixed the second with a script that builds a topic index note from my old labels, so shared themes link across the years.
Back at my desk, the question that started all of this has a quick answer now. Every old post is a note I can search, link, and learn from in a second or two, and my AI drafts finally sound like the person who wrote the archive. None of it depends on a dashboard, a login, or a company that might change its mind someday. The steps below walk through the same importer, image mirror, and topic index so you can rescue your own archive.
Prerequisites
To run the migration cleanly, download your Blogger XML backup file from Settings -> Manage Blog -> Back up content, create a Git-backed Obsidian vault (hosted on GitHub, GitLab, or self-hosted GitLab) so every imported note has revision history, and optionally use an AI coding assistant such as Antigravity, Claude Code, or Codex to refine custom tag mappings across older posts.
- Python
3.11+(either on a Linux workstation or inside apython:3.12-slimDocker container) withbeautifulsoup4andmarkdownifyinstalled inside a virtual environment. - A Blogger XML backup file saved at
/path/to/exports/blog-archive.xml. - A target Obsidian publication directory at
/path/to/git/publications/MyTechBlog.
Step 1: Set Up an Isolated Parser Environment and Inspect Atom Kinds
Blogger's export uses the Atom http://www.w3.org/2005/Atom namespace and mixes comments, settings, pages, and posts inside <entry> elements. Only entries carrying the category term http://schemas.google.com/blogger/2008/kind#post represent actual blog articles. Create an isolated virtual environment (or container) and verify your post count before writing files:
mkdir -p /path/to/git/blogger-migrator
cd /path/to/git/blogger-migrator
python3 -m venv .venv
.venv/bin/pip install beautifulsoup4 markdownify
Run a quick one-liner to count real post entries inside the XML export:
.venv/bin/python -c "
import xml.etree.ElementTree as ET
root = ET.parse('/path/to/exports/blog-archive.xml').getroot()
ns = {'a': 'http://www.w3.org/2005/Atom'}
posts = [e for e in root.findall('a:entry', ns)
if any('kind#post' in c.attrib.get('term', '') for c in e.findall('a:category', ns))]
print('Total post entries found:', len(posts))
"
Confirming this count upfront ensures zero comments or template snippets leak into your Posts/ folder.
Step 2: Convert Legacy HTML into Dated Markdown Notes and a JSON Manifest
Save /path/to/git/blogger-migrator/import_blogger_xml.py to extract each post's postId, title, publish date, Blogger labels, and live .html permalink, convert the HTML body into clean Markdown, write /path/to/git/publications/MyTechBlog/Posts/YYYY/MM/YYYY-MM-DD - <Title>.md, and record every post in Data/blogger-posts.json:
#!/usr/bin/env python3
import json
import pathlib
import re
import sys
import xml.etree.ElementTree as ET
from bs4 import BeautifulSoup
from markdownify import markdownify as md
ATOM_NS = {"a": "http://www.w3.org/2005/Atom"}
POST_KIND = "http://schemas.google.com/blogger/2008/kind#post"
TAG_SCHEME = "http://www.blogger.com/atom/ns#"
def safe_filename(title: str) -> str:
cleaned = re.sub(r'[\\/:*?"<>|]+', "", title).strip()
return re.sub(r"\s+", " ", cleaned)[:95] or "Untitled Post"
def extract_permalink(entry: ET.Element) -> str:
for link in entry.findall("a:link", ATOM_NS):
if link.attrib.get("rel") == "alternate" and link.attrib.get("type") == "text/html":
return link.attrib.get("href", "")
return ""
def convert_archive(xml_path: pathlib.Path, out_root: pathlib.Path) -> None:
tree = ET.parse(xml_path)
manifest: dict[str, dict] = {}
for entry in tree.getroot().findall("a:entry", ATOM_NS):
cats = entry.findall("a:category", ATOM_NS)
if not any(c.attrib.get("term") == POST_KIND for c in cats):
continue
raw_id = entry.findtext("a:id", default="", namespaces=ATOM_NS)
post_id = raw_id.rsplit("post-", 1)[-1]
title = (entry.findtext("a:title", default="Untitled", namespaces=ATOM_NS) or "Untitled").strip()
published = entry.findtext("a:published", default="2008-01-01T00:00:00Z", namespaces=ATOM_NS)
date_str = published[:10]
year, month = date_str[:4], date_str[5:7]
labels = [c.attrib["term"] for c in cats if c.attrib.get("scheme") == TAG_SCHEME and "term" in c.attrib]
url = extract_permalink(entry)
html_body = entry.findtext("a:content", default="", namespaces=ATOM_NS)
soup = BeautifulSoup(html_body, "html.parser")
body_md = md(str(soup), heading_style="ATX", bullets="-").strip()
stem = f"{date_str} - {safe_filename(title)}"
note_path = out_root / "Posts" / year / month / f"{stem}.md"
note_path.parent.mkdir(parents=True, exist_ok=True)
tag_list = ", ".join(f'"{lbl}"' for lbl in labels)
frontmatter = "\n".join([
"---",
"type: archived-blog-post",
f'title: "{title.replace(chr(34), chr(39))}"',
f"date: {date_str}",
f'post_id: "{post_id}"',
f'permalink: "{url}"',
f"tags: [{tag_list}]",
"---",
"",
f"# {title}",
"",
body_md,
"",
])
note_path.write_text(frontmatter, encoding="utf-8")
manifest[f"{stem}#part-1"] = {
"postId": post_id,
"published": published,
"status": "live" if url else "draft",
"url": url,
"labels": labels,
}
manifest_path = out_root / "Data" / "blogger-posts.json"
manifest_path.parent.mkdir(parents=True, exist_ok=True)
manifest_path.write_text(json.dumps(manifest, indent=2, sort_keys=True) + "\n", encoding="utf-8")
print(f"Imported {len(manifest)} posts into {out_root}")
if __name__ == "__main__":
convert_archive(pathlib.Path(sys.argv[1]), pathlib.Path(sys.argv[2]))
Run the importer against your archive file:
.venv/bin/python import_blogger_xml.py \
/path/to/exports/blog-archive.xml \
/path/to/git/publications/MyTechBlog
Step 3: Mirror Legacy Embedded Images Locally Against Link Rot
Posts from the late 2000s and early 2010s frequently point to bp.blogspot.com or legacy Picasa image hosts. Add a short asset downloader pass /path/to/git/blogger-migrator/mirror_images.py that scans Posts/**/*.md for http(s)://...blogspot.com/... image links, downloads each image into Data/Archive Images/, and rewrites the Markdown image target to a local Obsidian embed while recording the original URL in Data/blogger-posts.json:
#!/usr/bin/env python3
import hashlib
import pathlib
import re
import sys
import urllib.request
IMG_RE = re.compile(r"!\[([^\]]*)\]\((https?://[^)]+(?:blogspot\.com|ggpht\.com)[^)]+)\)")
def mirror_folder(pub_root: pathlib.Path) -> None:
img_dir = pub_root / "Data" / "Archive Images"
img_dir.mkdir(parents=True, exist_ok=True)
for md_file in sorted((pub_root / "Posts").rglob("*.md")):
txt = md_file.read_text(encoding="utf-8")
def repl(match: re.Match) -> str:
alt, url = match.group(1), match.group(2)
ext = ".jpg" if ".png" not in url.lower() else ".png"
fname = f"{md_file.stem[:10]}-{hashlib.sha1(url.encode()).hexdigest()[:10]}{ext}"
dest = img_dir / fname
if not dest.exists():
try:
urllib.request.urlretrieve(url, dest)
except Exception:
return match.group(0)
return f"![[{fname}|{alt or md_file.stem}]]"
updated = IMG_RE.sub(repl, txt)
if updated != txt:
md_file.write_text(updated, encoding="utf-8")
if __name__ == "__main__":
mirror_folder(pathlib.Path(sys.argv[1]))
Step 4: Build Topic Index Hub Notes to Light Up Obsidian's Graph View
Raw imported posts start as isolated islands until internal links connect shared themes across years. Generate a Topic Index.md Map of Content (MOC) grouping imported posts by frontmatter tags so 2008 Linux or hardware notes link directly alongside 2026 homelab builds:
.venv/bin/python -c "
import json, pathlib, collections
root = pathlib.Path('/path/to/git/publications/MyTechBlog')
manifest = json.loads((root / 'Data/blogger-posts.json').read_text())
by_tag = collections.defaultdict(list)
for key, meta in manifest.items():
note = key.split('#')[0]
for lbl in meta.get('labels', ['Untagged']):
by_tag[lbl].append(note)
lines = ['# Archive Topic Index', '']
for tag in sorted(by_tag):
lines.append(f'## {tag}')
for n in sorted(by_tag[tag]):
lines.append(f'- [[{n}]]')
lines.append('')
(root / 'Topic Index.md').write_text('\n'.join(lines), encoding='utf-8')
"
Open /path/to/git/publications/MyTechBlog in Obsidian, open Graph View (Ctrl+G), and confirm that shared tags and [[wikilinks]] cluster related experiments across decades while Data/blogger-posts.json gives automation scripts an instant duplicate-check ledger.
Replicate This Build with AI
If you use an AI coding agent such as Antigravity, Claude Code, Codex, or Gemini CLI, you can paste this prompt to recreate the same functional prototype on your own gear. Replace each placeholder in angle brackets with your own values before you run it.
You are a coding agent working in <project-dir>/blogger-migrator on <target-os>. Build a Blogger XML archive to Obsidian Markdown importer.
Inputs:
- Blogger XML backup at <path-to-blog-archive.xml>
- Target Obsidian publication folder at <obsidian-publication-dir> (inside a Git repository)
Create these files and constraints:
1. A Python 3.11+ virtual environment in <project-dir>/blogger-migrator/.venv with beautifulsoup4 and markdownify installed.
2. import_blogger_xml.py: parse the Atom namespace, keep only entries whose category term ends with kind#post, ignore comments, settings, pages, and theme entries. Convert each HTML body to Markdown with ATX headings. Write one note per post at <obsidian-publication-dir>/Posts/YYYY/MM/YYYY-MM-DD - <Title>.md with YAML frontmatter (title, date, post_id, permalink, tags from Blogger labels). Strip characters that are illegal in filenames.
3. A manifest at <obsidian-publication-dir>/Data/blogger-posts.json mapping each note key to postId, published timestamp, status, url, and labels.
4. mirror_images.py: find image links hosted on blogspot or ggpht domains inside the notes, download each into <obsidian-publication-dir>/Data/Archive Images/, rewrite the link to an Obsidian embed, and skip any download that fails without crashing.
5. A topic index step that writes <obsidian-publication-dir>/Topic Index.md with one section per label and a wikilink for every post under it.
Do not hardcode any personal hostnames, paths, or credentials. Take every path as a command line argument.
Verification: run the importer, then print the number of post entries found in the XML and the number of notes written. The two numbers must match. Then open three random notes and confirm the frontmatter, body, and image embeds render correctly. Report the commands you ran and the results.
Hardware & Gear Used in This Guide
- Workstation or container host: Linux desktop or Docker host running Python 3.12 for XML parsing and asset mirroring
- Knowledge base storage: Local NVMe workspace synchronized to a private self-hosted GitLab repository
- Backup storage: NAS RAID snapshot volume storing the original Blogger
.xmlexport alongside mirrored archival photos
Taking It to the Next Level
- Make the importer incremental. Store the last imported published timestamp in the manifest and run it nightly, so new posts land as Markdown automatically instead of waiting for another full XML export.
- Let an AI coding assistant scan note bodies for recurring project names and gear and insert wikilinks to the topic hubs, so the graph shows connections that your old labels never captured.
- Extract word-length distributions, paragraph lengths, and recurring sign-offs from the archive to build a grounded personal style guide that your writing agents must follow.
- Feed the manifest into a multi-agent editorial pipeline like the one in Setting Up a Paperclip Multi-Agent Organization to Write and Review Code, so agents check past posts for topic overlap before they draft anything new.
Where do your oldest digital notes or blog posts live right now, and could you still search them offline ten years from today?
Later,
SteveO
