Back up your Notion pages into Markdown and track them over time with Git.
This repo turns your digital notes into a version-controlled file system.
Because:
- Notion has limited native version history for free users
- Exporting by hand is tedious and gross
- Git is free
I made this to:
- Keep a versioned history of my personal Notion notes
- Automate daily backups via a local
cronjob - Track content drift over time
- Uses the notion-exporter package under the hood
- Reads Notion page URLs from a
.page_idsfile - Downloads each page as Markdown
- Organizes exports under
notion_exports/export_<timestamp>/ - Commits changes automatically to Git
-
Clone the repo
git clone https://github.com/yourusername/notion_versioning.git
-
Add your own Notion pages to
.page_idsClear out the notion_exports unless you want my notes -
Set up your .env file You'll need to grab your
token_v2andfile_tokencookies from Notion. More details at: notion-exporter -
Run
npm installto install dependencies -
Run the backup manually:
./daily-notion-backup.sh -
Set it up as a cron job (Optional)
cronntab -eThen add something like:0 7 * * * /path/to/daily-notion-backup.sh >> /tmp/notion_backup.log 2>&1
This is a super simple personal project. It exists mainly to soothe my irrational fear of losing digital thoughts. Use it, fork it, ignore it—whatever sparks joy ✨
MIT. You break it, you buy it. Just kidding. But also not really.