Skip to content
DocsLit

Migration 4 min read

A practical GitBook and MkDocs migration checklist

A step-by-step checklist for a GitBook migration or MkDocs migration: what to inventory first, how to read the import report, and how to keep old URLs working.

You've decided to move your docs, and now you're staring at a few hundred pages and a vague sense that something will break. This is the checklist we'd follow for a GitBook migration or an MkDocs migration, in the order we'd do it. It assumes you're moving to DocsLit, but the before and after sections apply to any move.

First, fairness to the tools you're leaving. GitBook is a good product if you want a hosted editor that non-developers can use without touching Git. MkDocs, and Material for MkDocs in particular, is mature and has a huge plugin ecosystem. If either one still fits how your team works, staying is a legitimate choice. People usually move because of cost, control over the output, or because the tool has stopped moving (the DocsLit docs note that Material for MkDocs is in maintenance mode until May 2027).

Before: inventory what you have

Do this part on paper before you run anything.

  • Get the source into Git. The importer reads a GitBook project that is synced to a Git repository, so turn on GitBook's Git sync first. For MkDocs you already have the folder with mkdocs.yml (or zensical.toml).
  • Count your pages and note which get real traffic. You'll spot-check those later.
  • List your custom bits. For GitBook, that's unusual block types such as OpenAPI blocks. For MkDocs, list every plugin in mkdocs.yml, any custom_dir theme overrides, Jinja macros, mike versions, i18n plugins and notebooks. These are the things that don't convert one to one.
  • Export your URLs. Save a list of every live URL, from your sitemap or analytics. You'll need it for redirects.
  • Write down what lives outside the repo. GitBook keeps the domain, visibility and customization in its app, so the importer can't read them. Note your logo, colors and domain settings by hand.

During: run the import and read the report

Start with a dry run. It converts everything and prints the report without writing files:

docslit import ./my-gitbook-docs --dry-run
docslit import ./my-mkdocs-project --dry-run

DocsLit detects the format from SUMMARY.md, .gitbook.yaml, mkdocs.yml, mkdocs.yaml or zensical.toml. If it guesses wrong, pass --from gitbook or --from mkdocs. Your source folder is never modified.

When the summary looks reasonable, run it for real into a new folder:

docslit import ./my-mkdocs-project --out ./my-docs
cd my-docs
docslit dev

The output includes MIGRATION.md, which is the file that matters. It groups items as Must fix, Review and For your information, each with the file and line, what the importer did instead, and how to fix it. Nothing is dropped silently. Content it can't convert stays in the page inside a warning callout so you can find it. If you'd rather script this, --json prints the same report as JSON.

Things that usually need a human

  • GitBook: unsupported {% ... %} tags are removed with a warning (the content is kept), and {% openapi %} blocks become a pointer callout. Add your spec with docslit openapi scaffold to generate API pages.
  • MkDocs: Jinja logic and macros aren't run (plain values under extra: become variables), theme overrides aren't copied, and mike versions, i18n plugins, .ipynb notebooks and script-generated pages aren't imported. mkdocstrings blocks stay in the page, and the report gives you the exact docslit api python command to run.

Work through Must fix first, then Review, then delete MIGRATION.md. Both guides cover the conversion tables in detail: from GitBook and from MkDocs.

After: keep your old URLs and rankings alive

This is the step people skip, and it's where search traffic gets lost. A page that moves without a redirect returns a 404 to anyone holding the old link, including search engines.

For MkDocs, page paths don't change, but the trailing slash does: MkDocs serves /page/ and DocsLit serves /page. Vercel and Cloudflare Pages redirect the old form. GitHub Pages doesn't, so those links 404 there until you add redirects or change hosts. If you used the MkDocs redirects plugin, those entries carry over.

For anything that did move, add entries to docslit.json:

{
  "redirects": {
    "/old-guide": "/getting-started/introduction"
  }
}

Builds emit meta-refresh stubs plus _redirects and vercel.json entries. Wildcard patterns aren't supported, so you add one entry per path. Take your saved URL list from the inventory step and test every high-traffic URL against the deployed site, with and without a trailing slash.

After: validate, spot-check, deploy

  1. Run docslit validate --strict for broken links, missing pages and unknown components. Add --external to check outside links too.
  2. Run docslit lint for quality problems such as missing descriptions, code blocks with no language and images with no alt text. It doesn't auto-fix anything, so expect to edit by hand.
  3. Click through your top pages in docslit dev. Check tabs, collapsibles, code blocks and sidebar order. MkDocs pages outside nav land in a hidden sidebar group, so move any that readers should find.
  4. Run docslit build and deploy. If you're still choosing a host, we compared the options in where to host static docs.
  5. Re-test your old URLs on the live site, then watch your search console for crawl errors over the next few weeks.

For every flag and issue code, see the import reference. To try the importer on a copy of your docs, install with npm install -g docslit and run the dry run above. It changes nothing.