Migrate an existing static site (Jekyll, Hugo, micro.blog) into your Indiekit deployment. The migrator is a Docker-only tool — no host-side Node or Python required.
1. Drop export → migration/input/
2. make migrate-detect # what's in there?
3. make migrate-convert FROM=hugo # transform → migration/staged/
4. Eyeball migration/staged/ (optional, recommended)
5. make migrate-preview # what would land in live volumes?
6. make migrate-apply # actually copy into the volumes
Each step is independent and idempotent. You can re-run migrate-convert
as many times as needed while iterating on _classify.yaml overrides
without dragging stale output forward.
FROM= |
Layout it expects | Migration path | New adapter |
|---|---|---|---|
jekyll |
_config.yml + _posts/YYYY-MM-DD-slug.md |
unverified | unverified |
hugo |
hugo.toml (or config.*) + content/** |
unverified | ✅ synthetic Hugo fixture passes end-to-end on localhost |
microblog |
Hugo-shaped export from micro.blog | ✅ proven in production — rmendes.net was migrated from micro.blog. Reference output: ~/code/indiekit-dev/indiekit-cloudron/migrated-content/ |
"Migration path" = whether anyone has actually moved real content from this source into Indiekit. "New adapter" = whether the adapter in this repo produces equivalent output. The two are distinct: micro.blog migration is a solved problem (real content runs on rmendes.net), but the new generic adapter has not been compared against that reference.
Deep-dive guides:
- Migrating from Hugo to Indiekit — full walkthrough; the same guide applies to micro.blog since micro.blog exports as Hugo
If detection fails (custom layout, no SSG config), pass FROM=hugo —
the Hugo adapter accepts any content/**/*.md tree.
For each markdown file it finds:
- Parse frontmatter with
gray-matter(YAML, TOML, JSON all accepted) - Classify the post type (article / note / photo / like / reply /
repost / bookmark / page) using:
- your
_classify.yamloverrides if present - explicit
type:in the frontmatter - response properties (
like-of,repost-of,in-reply-to,bookmark-of) - photo signals (frontmatter
photo:field, body that's only image refs) - adapter folder hints (Hugo section names)
- title-and-length heuristics
- your
- Slugify from filename, frontmatter
slug:, or title - Resolve media referenced in the body and copy into
staged/uploads/, preserving the original web path so unchanged markdown still renders - Build a redirect from the original URL to the canonical Indiekit URL
- Write Indiekit-shaped markdown into
staged/content/<type>/YYYY-MM-DD-slug.md
Output is grouped under migration/staged/:
staged/
├── content/
│ ├── articles/2024-03-15-foo.md
│ ├── notes/2024-04-02-quick-thought.md
│ ├── photos/2024-05-10-sunset.md
│ └── ...
├── uploads/
│ ├── assets/sunset.jpg ← preserved web path
│ └── 2024/05/header.png
└── Caddyfile.redirects ← import this from your Caddyfile
Place migration/input/_classify.yaml to force specific files into a
specific post type. Patterns are glob-matched against the file path
relative to input/. The first matching rule wins; user overrides take
precedence over all automatic classification.
overrides:
- pattern: "_posts/2019-*-microblog-*.md"
type: note
- pattern: "content/links/**"
type: bookmarkA copy-pasteable starting point lives at migration/_classify.example.yaml.
migrate-convert writes staged/Caddyfile.redirects containing one
redir directive per old URL. Import it from your main Caddyfile
inside the site block:
your-domain.example {
# ... existing site config ...
import /etc/caddy/migration-redirects
}Mount the staged file into the Caddy container or copy it into the
caddy_config volume — whichever fits your operations preference. The
exact path inside the Caddy container is the value you write after
import.
migrate-apply refuses to overwrite files that already exist in the
live content or uploads volumes. To override, run:
make migrate-apply FORCE=1This is intentionally noisy: migration is a one-shot operation, and overwriting a post you've already edited inside Indiekit is the kind of mistake that's hard to undo.
This first version writes markdown directly into the content volume
and bypasses Indiekit's MongoDB index. Eleventy will render the posts;
they'll be reachable at their canonical URLs and visible in feeds.
They will not appear in the Indiekit admin UI's posts list, and the
admin "edit" / "syndicate" buttons won't apply to them.
A future "replay through Micropub" mode will let users re-import the same staged tree through the Micropub endpoint so MongoDB tracks them too. Until then, treat migrated posts as historical archive that you read but rarely edit through Indiekit.
- Ghost JSON exports
- WordPress WXR exports
- Eleventy-to-Eleventy migrations
- MDX-aware adapters (Astro, Next.js)
- Replay through Micropub (so posts appear in admin UI)
PRs welcome — the adapter contract is a single convert(ctx) function
returning { posts, mediaSources, redirects, warnings }.