Notion Backup
Automated backup connector for Notion workspaces. Export all your pages, databases, and comments to LOX for secure, versioned storage.
Features
- Full workspace backup (pages + databases)
- Recursive export of nested pages and blocks
- Comments and discussions included
- JSON format for easy migration
- Scheduled automated backups
- Selective backup (databases only, pages only)
Quick Setup
Step 1: Create Notion Integration
- Go to notion.so/my-integrations
- Click "New integration"
- Name it "LOX Backup" and select your workspace
- Under Capabilities, enable "Read content" and "Read comments"
- Click "Submit"
- Copy the Internal Integration Token (starts with
secret_)
Step 2: Connect Integration to Pages
Important
Notion integrations can only access pages explicitly shared with them. You must connect the integration to each top-level page or database you want to back up.
- Open any page or database in Notion
- Click the "..." menu in the top-right corner
- Select "Connections" → "Add connections"
- Find and select "LOX Backup"
- Repeat for all top-level pages/databases you want to back up
Step 3: Run the Connector
docker run -d \ --name lox-notion-backup \ -e NOTION_TOKEN=secret_xxxxxxxxxxxxxxxxxxxx \ -e LOX_API_KEY=your-api-key \ -e BACKUP_SCHEDULE="0 3 * * *" \ loxbackup/notion-connector:latest
Docker Compose
version: '3.8'
services:
lox-notion-backup:
image: loxbackup/notion-connector:latest
environment:
- NOTION_TOKEN=${NOTION_TOKEN}
- LOX_API_KEY=${LOX_API_KEY}
- LOX_BASE_URL=https://backlox.com/api
- BACKUP_SCHEDULE=0 3 * * *
- BACKUP_RETENTION_DAYS=30
- BACKUP_DATABASES=true
- BACKUP_PAGES=true
- INCLUDE_COMMENTS=true
- INCLUDE_CHILD_PAGES=true
- RUN_MODE=cron
restart: unless-stoppedConfiguration
Notion Settings
| Variable | Default | Description |
|---|---|---|
| NOTION_TOKEN | - | Integration token (required) |
| NOTION_WORKSPACE_ID | - | Workspace ID (optional) |
Backup Settings
| Variable | Default | Description |
|---|---|---|
| BACKUP_DATABASES | true | Include databases in backup |
| BACKUP_PAGES | true | Include pages in backup |
| INCLUDE_COMMENTS | true | Include page comments |
| INCLUDE_CHILD_PAGES | true | Recursively include nested pages |
| BACKUP_SCHEDULE | 0 3 * * * | Cron schedule expression |
| BACKUP_RETENTION_DAYS | 30 | Days to retain backup |
Backup Format
The backup creates a compressed archive with the following structure:
notion-backup-20251225_030000.tar.gz
├── manifest.json # Backup metadata
├── databases/ # Database exports
│ ├── abc123-def456.json
│ └── ...
└── pages/ # Page exports
├── xyz789-uvw012.json
└── ...Page JSON Structure
{
"metadata": {
"id": "page-uuid",
"object": "page",
"created_time": "2025-01-15T10:00:00.000Z",
"last_edited_time": "2025-12-20T15:30:00.000Z",
"properties": { ... }
},
"blocks": [
{
"id": "block-uuid",
"type": "heading_1",
"heading_1": {
"rich_text": [{ "plain_text": "My Heading" }]
},
"children": [ ... ]
}
],
"comments": [
{
"id": "comment-uuid",
"discussion_id": "...",
"rich_text": [{ "plain_text": "Comment text" }]
}
]
}Database JSON Structure
{
"metadata": {
"id": "database-uuid",
"object": "database",
"title": [{ "plain_text": "My Database" }],
"properties": {
"Name": { "type": "title" },
"Status": { "type": "select", "select": { ... } }
}
},
"rows": [
{
"id": "row-uuid",
"properties": {
"Name": { "title": [{ "plain_text": "Row 1" }] },
"Status": { "select": { "name": "Done" } }
}
}
],
"row_count": 42
}Use Cases
Disaster Recovery
Protect against accidental deletion, account issues, or Notion outages.
Data Export
Machine-readable JSON format for migration or integration with other tools.
Compliance
Meet data retention requirements with versioned, immutable backups.
Historical Versions
Keep snapshots of your workspace over time for auditing or rollback.
Troubleshooting
Empty backup / No items found
The integration hasn't been connected to any pages. Open each top-level page in Notion and add the integration via Connections → Add connections.
"Could not find object" error
The page or database was deleted or the integration lost access. Re-add the integration to the affected pages.
Rate limit errors
Notion limits to 3 requests/second. The connector handles this automatically, but very large workspaces may take longer. Consider running during off-hours.
Check logs
View connector logs for detailed export progress: docker logs lox-notion-backup
Limitations
- File attachments are not included (Notion API limitation)
- Embedded images reference external URLs, not downloaded
- Page permissions and sharing settings are not backed up
- Deleted pages cannot be recovered from Notion