Table of Contents
Open Table of Contents
What happened
This site is at the end of a transition from my old Hugo based blog to the current Astro setup.
The old repository still contained a lot of historical posts and assets, but I wanted the content to live in the current project and I wanted the old URLs to survive.
This time I did not migrate those posts manually. Instead I worked together with Codex
While the prompt for Codex was something banal like
long in that folder /path-to-hugo-blog and copy all post to new Astro schema. Make sure all urls are preserved and post render. Compare the path resolution and basic parameters to the live version https://alexander.holbreich.org/
Since the default frontmatter of tho folder is different Codex had to take care of thing like
- Change Hugo’s
urlfield into Astro’sslugfield - preserve local images and page bundle assets and put them into ride place.
- validate that old routes still resolve correctly
Risk was breaking URLs, losing images, damaging frontmatter, or silently ignoring strange legacy content.
What Codex did
Codex inspected both repositories:
- the current Astro blog
- the old Hugo repository at
../path-to-hugo-blog
Codex then created two scripts:
scripts/migrate-hugo-posts.mjs
scripts/validate-hugo-routes.mjs
The migration script imported posts from the old Hugo content/posts directory, normalized frontmatter, copied assets, transformed some Hugo-specific constructs, and generated migration reports.
The validation script checked for duplicated published slugs and helped verify that the route structure stayed consistent.
Legacy content was/is messy
The first run was not perfect, and that was expected. The old content had typical migration problems: like duplicates keys, draft post with conflicting keys, missing image files, outdated shortcodes, everything you could think off.
Result
Withins several round of correction and try and error. (The full session took around 15 minutes) Code CLI greatly accomplished the task.
Some stats:
- 125 published posts migrated
- additional drafts imported
- assets copied where available
- old slugs preserved
- duplicate routes checked
- Astro build completed successfully
- migration reports generated
For this kind of work, that is a strong outcome
The old DISQUS comments
Another thing to mention are blog comment i used until yesterday. These where powered by DISQUS platform.
At first I was not sure what to do with them. Hardly anyone comments on private blogs anymore. Most discussions now happen somewhere else — on X, Facebook, Reddit, LinkedIn…
But simply deleting the old comments felt wrong. They are part of the history of the blog. Some of them add context, corrections, or just show that the article once had a small conversation around it.
So I asked the agent for ideas.
The solution I liked most was to keep the comments as static historical content. No active comment system, no third-party script, no tracking widget, no new dependency on DISQUS. Just render the old comments below the migrated articles where they exist.
The workflow was surprisingly smooth. I exported the comments from DISQUS as a zipped XML file and downloaded the archive. After that, the agent handled most of the work:
- found the downloaded export on my system
- unpacked the archive
- parsed the XML
- converted the data into a new JSON structure
- matched comments to migrated blog posts
- created the Astro rendering logic
- added the static comments section to the relevant articles
After two or three iterations, it was working.
An example is here: Docker Ghost Image
That was one of the best parts of the migration. Instead of bringing back an old dynamic comment system, the old discussions are now preserved as static content. The history remains visible, but the new site stays simple, fast, and privacy-friendly.
What I learned
AI Agents are especially useful for messy migration work like this. Who (asking a Human here) wants to spend time on inspecting files, writing one time scripts, fail, analyst fail, fixing edge cases? - Exactly.
In 2026 KI Agents are absolutely useful in these situations.