Improving Notion Workspace Exports (for Backup with Git)

Introducing the tool Notion Export Enhancer and describing how to use it to make better backups for Notion.

Improving Notion Workspace Exports (for Backup with Git)
Notion Export - Makes me sad 😭

Notion provides a handy feature to export ALL your data as a ZIP file.

This is great in theory, but unfortunately the created workspace export files leave lots to be desired.

I have developed a free, open-source tool to enhance the ZIP files Notion creates.

You can download it here:

Notion Backup Enhancer - GitHub

In this article, I explain why its useful to enhance your Notion export files and then how to use the tool I developed.

Why 'Fix' Notion Workspace Exports

When exporting your workspace with Notion, the resulting ZIP file, will have the following issues:

  • The ZIP archive does not contain the exported files, but instead another zip that first needs to be extracted ...
  • File paths are artificially made longer by some kind of hexadecimal hash added to every file path
  • Many files are duplicated (especially the CSV files)
  • When a workspace contains a 'shared' space, that is included in the ZIP by its name, but then always contains a folder that has a hex id.

This makes it very difficult to store these backup files efficiently.

Notion workspaces are easily multiple gigabytes large, and storing these huge ZIP files as is can quickly become expensive.

What I like to do is backup my Notion workspaces into a GitHub repository.

This allows me to track changes in individual files and databases in a place outside Notion.

However, this does not work with the Notion workspace export files out of the box.

That's why I developed a tool and workflow to make the exports usable for a decent backup strategy.

How to Fix Notion Workspace Exports

Using the tool Notion Backup Enhancer I have developed, I now fix my Notion exports using the following workflow:

  • Download Notion Workspace Export - I use the following settings:
    • Export format: Markdown & CSV
    • Include Databases: Default View
    • Include Content: Everything
    • Create Folders for Subpages: Checked
Notion Export Settings
  • Download latest release for Notion Backup Enhancer executable
    • Download .exe file if you are on Windows
    • Download the file without extension if you are on Mac OS X
  • Drag and drop the downloaded ZIP file from Notion onto Notion Backup Enhancer executable
Dragging and Dropping Notion Export ZIP
  • The tool will create a .fixed.zip file in the same directory
  • I then move this file into a local git repository and simply extract it
  • Finally, I delete the ZIP file and commit and push the files to GitHub

I've also added detailed instructions to the repository README how to do this.

How Does it Work?

I started with the script provided in notion_export_enhancer that applies various magic to a Notion export – but unfortunately did not work for me.

So I simplified it and made it work with the most recent version of Python.

I use Python's built-in archive processing to first read in all the workspace files, then map them to new file names, and eventually write them into a new ZIP file.

It's not the fastest, but it works and it's sure faster than doing it manually.

Please be welcome to check out the source code.

Onward and Upward

I'm using the tool and workflow I developed to backup and version control all the workspaces for Pureleap.

However, I'm pretty sure it doesn't yet quite work as well as it should.

So if this is something that could be of use to you, please give it a try and let me know all that is wrong with it!

Simply create an issue in the repository and I'm happy to fix it for you and everyone else.