Skip to content

Switch from Notion

Import a Notion export as typed markdown documents in your repository.

Last revised

DocumentationSwitch from Notion
On this page

What you get

Your Notion pages become markdown files in a folder of your repository, and your databases become typed documents you can query. Nothing stays behind in a proprietary format: after the import there is no notdocs-specific export to worry about, because the files are the export.

Export from Notion

In Notion, open the workspace or page you want to move and choose Export, format Markdown & CSV, with subpages included. You get a zip.

Import

From the workspace, open a project's import page and drop the zip. From the CLI:

sh
notdocs import notion ./Export-….zip --into docs/notion --dry-run
notdocs import notion ./Export-….zip --into docs/notion

--dry-run prints every file that would be created and stops. The default destination is docs/notion.

Before and after

Notion export
Export-3f2a…/
  Launches 9c1e…/
    Pricing launch 7b40….md
    Tasks 51aa….csv
    Tasks 51aa…/
      Annual toggle 0d2f….md
      Tier names 88c1….md
Your repository
docs/notion/
  launches/
    pricing-launch.md          type: page
    tasks/
      annual-toggle.md         type: task, status: doing
      tier-names.md            type: task, status: done

The ids leave the file names and the links; the database properties land in frontmatter; the folder shape stays yours.

What the importer does

  • Strips the Export-<uuid>/ wrapper folder and the 32-character page ids Notion appends to every file name and link, so paths read the way they did in Notion.
  • Turns each database row into a typed document: a row whose database has a Status property becomes a task, everything else a page. Properties become frontmatter, fitted to the type's fields (Urgent, High, Medium and Low become p0 to p3; several assignees are joined; numbers and dates are written as text), and a value that still does not fit is kept as notion<Name> rather than refused.
  • Gives two pages whose names match once the ids are gone their own files, Name.md and Name-2.md, and points their links at the right one.
  • Rewrites links between pages to relative markdown links that resolve after the rename.
  • Stamps every document with an id on first sight, so later renames do not break links.

After the import

Open any imported database folder and add a query block to see it as a board:

markdown
```notdocs
type: task
view: board
groupBy: status
```

Everything from here on is a commit: the import lands as ordinary files, your agents can read them the same day, and you can leave whenever you want by doing nothing at all.