Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Feb 22, 2024 · 3 comments

Comments

@developerisnow
Copy link

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:

  • 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.
  • Ensure that the backup mirrors the full structure and content of the Notion workspace, providing a complete offline snapshot.

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

  • The script's current functionality is highly valuable for top-level and first-level subpage backups.
  • The enhancement is aimed at making the tool even more powerful for users needing detailed backups of complex Notion workspaces.
@karlhorky
Copy link
Member

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
Copy link
Author

developerisnow commented Feb 22, 2024

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants