Notion is a fantastic tool for organizing your notes, tasks, and more, but what happens if you lose that precious data? Fear not! NotionUp is here to save the day. This Python repository automates the backup process of your Notion data, ensuring that you never lose important information. Let’s explore how to get started with NotionUp!
Getting Started
Preparation Steps
Before diving into the code, there are a couple of things you need to get ready:
- Have your Notion username (email) and password ready, or simply locate your
notion_token_v2
. - Run
notion-up/main.py
with your configuration settings.
If you need help finding your notion_token_v2
, check this guide.
Running NotionUp
Command Line Interface (CLI)
To run your NotionUp backup, you simply need to use the command line interface. Here’s how to do it:
PYTHONPATH=. python main.py --token_v2 --username --password
Note: Use --username
and --password
only when you don’t have the token_v2
. Alternatively, you can run:
PYTHONPATH=. python main.py --config_file .json
Remember, the priority for configuration is as follows: CLI arguments > configuration file > System Environment parameters > Notion default settings.
Archiving to GitHub Release
To take advantage of GitHub releases for your backups, ensure you follow the workflows outlined in .circleci/config.yml
. Here’s a peek at how to set it up:
workflows:
backup-notion:
jobs:
- export-workspace
- publish-github-release:
requires:
- export-workspace
For example outputs, take a look at the Release section or check the exported data at notion-exported.
Setting Up Nightly Backups
If you want to automate your backups every night, utilize the following crontab workflows:
workflows:
backup-notion-nightly:
triggers:
- schedule:
cron: 0 * * * * # every hour
filters:
branches:
only:
- master
jobs:
- export-workspace
- publish-github-release:
requires:
- export-workspace
Troubleshooting Tips
Here are some common troubleshooting ideas to ensure your backup runs smoothly:
- Ensure that your Notion credentials are correct.
- If using a
token_v2
, double-check its validity. - Review your configuration settings in case of errors.
- Check your internet connection and access to Notion’s servers.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.