Migrate from Fumadocs
Farming Labs Docs builds on the Fumadocs content and UI ecosystem for its Next.js experience, so
standard Markdown, MDX, meta.json, and many familiar components can be preserved. The migration
primarily removes repeated source, layout, route, and feature wiring.
Simplify incrementally
First make the existing content render through Farming Labs Docs. Remove old loaders, routes, and packages only after the new production build passes.
1. Inventory the source
Record:
source.config.tscollections and their directories- the docs collection root, commonly
content/docs meta.jsonor equivalent meta fileslib/source.tsloader options andbaseUrl- docs layout and catch-all route files
mdx-components.tsx- search, OpenAPI, i18n, last-modified, and custom source adapters
- custom collections such as blog or changelog
2. Decide what to keep
| Existing Fumadocs layer | Migration decision |
|---|---|
| Markdown and MDX content | Keep |
| Page frontmatter | Keep portable fields and review schema extensions |
meta.json ordering | Keep where supported or translate to file order |
| Fumadocs UI components | Keep compatible components or use Farming Labs defaults |
| Custom source loader | Replace for standard docs; preserve for custom collections |
| Catch-all route and layout | Replace with generated adapter route/layout |
| Search route | Replace with Farming Labs search configuration |
| OpenAPI integration | Reconfigure through apiReference |
Avoid rewriting working content just to change the framework wrapper.
3. Preserve the base route
Read baseUrl in the existing loader:
export const source = loader({
baseUrl: "/docs",
source: docs.toFumadocsSource(),
});Use the same value as the Farming Labs entry whenever the public route should remain unchanged:
export default defineDocs({
entry: "docs",
theme: fumadocs(),
});If the old base URL changes, create and test redirects before cutover.
4. Move or reuse content
For Next.js, move each content route into the generated app/docs/**/page.mdx structure when the
adapter expects route-local pages. For TanStack Start, SvelteKit, Astro, and Nuxt, point
contentDir at the migrated Markdown tree.
Preserve:
- title and description
- slug implied by the file path
meta.jsonorder and labels- links, headings, images, and code fence metadata
- supported Fumadocs MDX components
Review custom Zod frontmatter fields from source.config.ts; unsupported fields can remain content
metadata only when the target loader preserves them.
5. Replace source and layout wiring
Once content renders:
- Use generated Farming Labs docs routes and layout.
- Move theme and feature options into
docs.config.ts. - Register local MDX components through
components. - Configure search, page actions, MCP, sitemaps, and API reference from the same config.
- Remove the old docs loader and route only when nothing else imports them.
Keep custom non-doc collections and their generated source files until they receive a separate migration decision.
6. Check component compatibility
Many Fumadocs UI components can remain in a Next.js target, but Farming Labs provides defaults for common docs primitives. Verify:
- callouts
- tabs
- cards
- steps
- accordions
- type tables
- code blocks
- custom imports and interactive client components
For another target runtime, convert React-only MDX components to portable Markdown or native components for that adapter.
7. Recreate advanced features
Translate these intentionally:
fumadocs-core/searchroutes →search- OpenAPI source and pages →
apiReference - custom page tree transforms → file structure or custom sidebar
- i18n sources → Farming Labs locale configuration
- last-modified logic → source timestamps and metadata
- custom remark/rehype plugins → adapter-supported MDX configuration or content conversion
8. Validate and recover
Run the production build and compare:
- loader
baseUrland every published docs route - page tree order and
meta.jsonbehavior - custom collections outside docs
- imported components and client boundaries
- search and OpenAPI endpoints
.mdpage delivery and page actions
If source generation conflicts, remove only the overlapping docs loader or route. If a custom collection disappears, restore its Fumadocs source and migrate it separately.
Source references
Migrate Fumadocs content, meta files, source loaders, layouts, and components
How is this guide?