upleveled / notion-backup

Export Notion pages and subpages to a GitHub repo on a schedule (eg. to be used as a scheduled backup)
49 stars 8 forks source link

Recursively identify all nested pages and databases within the Notion workspace, regardless of nesting depth. Export these items based on their content type: as .md files for pages and .csv files for databases. #260

Open developerisnow opened 6 months ago

developerisnow commented 6 months ago

Title:

Enhancement: Extend notion-backup to Recursively Download All Content as .md or .csv

Body:

Description

The notion-backup script is currently capable of exporting top-level Notion pages and their immediate subpages. However, for nested content beyond the first level of subpages, it only downloads links rather than the actual content. For a comprehensive backup, there's a need for the script to recursively download all nested pages and databases, exporting them as .md (Markdown) or .csv (Comma Separated Values) files, depending on the content type.

Current Behavior

When executing a backup, the script processes top-level pages and their direct subpages correctly, exporting them as expected. However, at deeper nesting levels, it only captures links to these pages or databases instead of downloading the actual content.

Desired Enhancement

Modify the script to:

Potential Approach

A potential approach to achieve this could involve:

  1. Enhancing the script's logic to traverse the Notion page hierarchy more deeply.
  2. Implementing functionality to check each item's content type and choose the appropriate export format.
  3. Testing with Notion workspaces that have complex nested structures to ensure comprehensive coverage and functionality.

Additional Context

karlhorky commented 6 months ago

Hm, are you sure that this is what is happening for you? We have multiple levels of nesting in one project and it appears to be exporting everything correctly... 🤔

developerisnow commented 6 months ago

Yeah, I'm sure, please check attachment

Screenshot 2024-02-22 at 21 51 28

On the screen you'll see pages which have more then 2-3 deeper levels, and source(not a linked) databases

P.S. It seems Notion is eager to send me a bill before allowing a full backup. At this rate, I'll be switching to Obsidian for good – they're about to lose me to the dark (mode) side! :D

karlhorky commented 6 months ago

Ahh maybe this doesn't work with unpaid plans?

If so, that would be potentially something good to add to the readme.

cc @richartkeil, in case this is also affecting notion-guardian