@jiahaoshao1/notion-lifeos-fixer
v1.0.2
Published
Automatically fix database relations after duplicating LifeOS template
Maintainers
Readme
Notion LifeOS Relation Fixer
Automatically fix database relations after duplicating the LifeOS template.
Problem
When you duplicate a Notion template with multiple databases and relations between them, all the relation properties break because they reference the old database IDs.
This tool automatically scans your duplicated LifeOS page, finds all databases, and rebuilds the relations between them.
Installation
npx @jiahaoshao1/notion-lifeos-fixer <page_url> [api_key]No installation needed! Just use npx to run it directly.
Usage
Step 1: Duplicate the LifeOS Template
Go to the LifeOS Template and click "Duplicate" in the top right corner.
Step 2: Get Your Notion API Key
- Go to Notion Integrations
- Click "+ New integration"
- Give it a name (e.g., "LifeOS Fixer")
- Copy the "Internal Integration Token"
Step 3: Share Your Page with the Integration
- Open your duplicated LifeOS page
- Click "Share" in the top right
- Click "Invite"
- Search for your integration name and select it
Step 4: Run the Fixer
npx @jiahaoshao1/notion-lifeos-fixer https://www.notion.so/Your-LifeOS-Page-abc123 secret_your_api_keyOr set the API key as an environment variable:
export NOTION_API_KEY=secret_your_api_key
npx @jiahaoshao1/notion-lifeos-fixer https://www.notion.so/Your-LifeOS-Page-abc123What It Does
The fixer will:
- Scan your page for all child databases
- Identify each database by name (Task Database, Notes Database, etc.)
- Rebuild all relation properties according to the LifeOS schema:
- Task → Projects, Notes
- Notes → Projects, Areas, Resources
- Projects → Notes, Areas, Resources
- Resources → Projects, Notes, Areas
- Areas → Notes, Resources
- Make Time → (no relations)
Example Output
🚀 Starting LifeOS Relation Fixer
📄 Page ID: 2f6119f193ef80c88aaffeb3286ff632
📊 Scanning databases...
✓ Found: Task Database (abc123...)
✓ Found: Notes Database (def456...)
✓ Found: Projects Database (ghi789...)
✓ Found: Resources Database (jkl012...)
✓ Found: Areas Database (mno345...)
✓ Found: Make Time Database (pqr678...)
🔗 Updating relations...
🔧 Task Database:
✓ Related to Projects → Projects Database
✓ Related to Notes → Notes Database
🔧 Notes Database:
✓ Related to Projects → Projects Database
✓ Related to Areas → Areas Database
✓ Related Resources → Resources Database
...
✅ All relations fixed successfully!Troubleshooting
"NOTION_API_KEY not found"
Make sure you either:
- Pass the API key as the second argument
- Set the
NOTION_API_KEYenvironment variable
"No databases found in this page"
Make sure:
- You're using the URL of the duplicated page (not the original template)
- The page contains the LifeOS databases as child databases
- You've shared the page with your integration
"Invalid Notion page URL"
The URL should look like:
https://www.notion.so/LifeOS-2f6119f193ef80c88aaffeb3286ff632https://www.notion.so/2f6119f193ef80c88aaffeb3286ff632
License
MIT
Author
Jiahao Shao
