Giter VIP home page Giter VIP logo

keenster-notion-guardian's Introduction

Notion Guardian

A tool that automatically backups your Notion workspace and commits changes to another repository.

Notion Guardian offers a quick way to setup a secure backup of your data in a private repository โ€” allowing you to track how your notes change over time and to know that your data is safe.

The tool separates the logic for running the export and the actual workspace data into two repositories. This way your backups are not cluttered with other scripts. If you prefer to have a one-repo solution or want to backup specific blocks of your workspace, checkout the notion-backup fork by upleveled.

How to setup

  1. Create a separate private repository for your backups to live in (e.g. "my-notion-backup"). Make sure you create a main branch โ€” for example by clicking "Add a README file" when creating the repo.
  2. Fork this repository ("notion-guardian").
  3. Create a Personal Access Token (docs) with the "repo" scope and store it as REPO_PERSONAL_ACCESS_TOKEN in the secrets of the forked repo.
  4. Store your GitHub username in the REPO_USERNAME secret.
  5. Store the name of your newly created private repo in the REPO_NAME secret (in this case "my-notion-backup").
  6. Store the email that should be used to commit changes (usually your GitHub account email) in the REPO_EMAIL secret.
  7. Obtain your Notion space-id and token as described in this Medium post. Store it in the NOTION_SPACE_ID and NOTION_TOKEN secret.
  8. You will also need to obtain your notion_user_id the same way and store it in a NOTION_USER_ID secret.
  9. Click the "Actions" tab on the forked repo and enable actions by clicking the button.
  10. On the left sidebar click the "Backup Notion Workspace" workflow. A notice will tell you that "Scheduled Actions" are disabled, so go ahead and click the button to enable them.
  11. Wait until the action runs for the first time or push a commit to the repo to trigger the first backup.
  12. Check your private repo to see that an automatic commit with your Notion workspace data has been made. Done ๐Ÿ™Œ

How it works

This repo contains a GitHub workflow that runs every day and for every push to this repo. The workflow will execute the script which makes an export request to Notion, waits for it to finish and downloads the workspace content to a temporary directory. The workflow will then commit this directory to the repository configured in the repo secrets.

Keenster's small changes

  1. Change timezone to Asia/Shanghai for China users.
  2. Add flattenExportFiletree option to create folders for subpages.

keenster-notion-guardian's People

Contributors

karlhorky avatar qq849012418 avatar richartkeil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.