NotionUp (Notion Backup) is a python repo helping you to backup notion data automatically.
To get started with NotionUp, you should:
- Prepare your Notion's username(email) and password, or just find your
notion_token_v2. - Run
notion-up/main.pywith your configs.
Check here to find out your notion_token_v2 if need. BTW, file_token can also be found here, and if you don't find file_token, you need to have at least had exported a file manually once.
Basically just run notion-down/main.py :
# Run with cli cmd
PYTHONPATH=./ python main.py
--token_v2 <token_v2>
--username <username> # Only when token_v2 is not presented
--password <password> # Only when token_v2 is not presented
# or
PYTHONPATH=./ python main.py \
--config_file '.config_file.json'
# Your can configure notion-down args by cli-args, config_file or SysEnv parameters
# Priority: cli args > config_file > SysEnv parameters > NotionDown defaultNotionUp provides a GitHub Actions workflow to automate the backup process. Check .github/workflows/notion-backup.yml for details.
The workflow performs the following:
- Export: Downloads your Notion workspace as a HTML/Markdown ZIP.
- Scrub: Automatically removes sensitive
*Personals*directories. - Flatten: Unzips and flattens the directory structure for clean Git history.
- LFS: Supports Git LFS for large binary attachments (images, PDFs).
- Release: Creates a GitHub Release with the cleaned ZIP archive.
As examples, check the output at Release and the dist directory.
You can enable the cron job in the workflow file to run backups automatically (e.g., weekly).
on:
schedule:
- cron: '0 22 * * 0' # Sundays at 22:00 UTCThe workflow includes granular run modes:
real_backup: Standard production run (Export -> Cleanup -> PR -> Release).debug_exported_url: Tests Notion API connectivity and export URL generation.debug_unzipping: Skip the slow export and test the processing logic using the latest release ZIP.
Integrated with GitHub Actions. See .github/workflows/notion-backup.yml.