Notion Backup

Automated backup connector for Notion workspaces. Export all your pages, databases, and comments to LOX for secure, versioned storage.

v1.0.0Updated 2026-01-01

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

  1. Go to notion.so/my-integrations
  2. Click "New integration"
  3. Name it "LOX Backup" and select your workspace
  4. Under Capabilities, enable "Read content" and "Read comments"
  5. Click "Submit"
  6. 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.

  1. Open any page or database in Notion
  2. Click the "..." menu in the top-right corner
  3. Select "Connections""Add connections"
  4. Find and select "LOX Backup"
  5. 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-stopped

Configuration

Notion Settings

VariableDefaultDescription
NOTION_TOKEN-Integration token (required)
NOTION_WORKSPACE_ID-Workspace ID (optional)

Backup Settings

VariableDefaultDescription
BACKUP_DATABASEStrueInclude databases in backup
BACKUP_PAGEStrueInclude pages in backup
INCLUDE_COMMENTStrueInclude page comments
INCLUDE_CHILD_PAGEStrueRecursively include nested pages
BACKUP_SCHEDULE0 3 * * *Cron schedule expression
BACKUP_RETENTION_DAYS30Days 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