Skip to main content

bookstack-file-exporter

Table of Contents

Background

If you encounter any issues, want to request an additional feature, or provide assistance, feel free to open a Github issue.

This self-admittedly, overly complicated tool provides a way to export Bookstack pages and their content (text, images, attachments, metadata, etc.) into a relational parent-child layout locally with an option to push to remote object storage locations. See Backup Behavior section for more details on how pages are organized. Image and attachment links can also be modified in markdown and html exports to point to local exported paths.

This small project was mainly created to run as a cron job in k8s but works anywhere. This tool allows me to export my docs in markdown, or other formats like pdf. I use Bookstack's markdown editor as default instead of WYSIWYG editor and this makes my notes portable anywhere even if offline.

Features

What it does:

  • Discover and build relationships between Bookstack Shelves/Books/Chapters/Pages to create a relational parent-child layout
  • Export Bookstack pages and their content to a .tgz archive
  • Additional page content: images, attachments, and metadata can also be exported
  • The exporter can also Modify Links to replace image and/or attachment links with local exported paths for a more portable backup
  • Fine grained filtering, selectable export levels (books/chapters/pages), and parallelization to speed up download of contents and assets
  • YAML configuration file for repeatable and easy runs
  • Can be run via Python or Docker
  • Can push archives to remote object storage like MinIO or AWS S3
  • Basic housekeeping option (keep_last) to keep a tidy archive destination
  • Can run in application mode (always running) using run_interval (interval-based) or run_schedule (cron-based) properties. Used for scheduling backups.

Supported backup targets are:

  1. local filesystem
  2. S3-compatible object storage — AWS S3, MinIO, Ceph, Cloudflare R2, Backblaze B2, Wasabi, DigitalOcean Spaces, etc. There is no type field; a target is treated as a custom store or AWS S3 based on whether an endpoint is set. See Remote Storage.

Supported backup formats are based on Bookstack API and shown here and below:

  1. html
  2. pdf
  3. markdown
  4. plaintext
  5. zip

Use Case

The main use case is to backup all docs in a relational directory-tree format to cover the scenarios:

  1. Share docs with another person to keep locally.
  2. Offline copy wanted.
  3. Back up at a file level as an accessory or alternative to disk and volume backups.
  4. Migrate all Bookstack page contents to Markdown documenting for simplicity.
  5. Provide an easy way to do automated file backups locally, in docker, or kubernetes for Bookstack page contents.

Documentation

Detailed docs live under docs/:

  • Getting Started — install via Pip/Docker/Helm, CLI options, environment variables, authentication
  • Configuration — full config.yml reference, all options, environment variables, export level, parallel export
  • Operations — run modes, scheduling, run outcomes & exit codes, graceful shutdown, health endpoint
  • Filters — include/exclude shelves, books, chapters, pages by name
  • Backup Behavior — archive layout, file naming, images (incl. secure image storage), attachments, modify-links
  • Remote Storage — MinIO / S3 upload, credential resolution, multi-target behavior, v2→v3 migration
  • Notifications — apprise notifications on export success/failure

Potential Breaking Upgrades

Below are versions that have major changes to the way configuration or exporter runs.

Start Version Target Version Description
< 3.0.0 3.0.0 For more details on exact changes see v3.0.0. Highlights below:
- modify_markdown key removed, use modify_links instead.
- The top-level minio: config block is removed. Replace it with an object_storage:, see Migrating from v2.
- http_config.verify_ssl now defaults to true (was false).
- The legacy assets.modify_markdown key is removed, used assets.modify_links instead (HTML also supported).
< 1.4.X 1.5.0 assets.verify_ssl has been moved to http_config.verify_ssl and the default value has been updated to false. additional_headers has been moved to http_config.additional_headers

Future Items

  1. Be able to pull images locally and place in their respective page folders for a more complete file level backup.
  2. Include the exporter in a maintained helm chart as an optional deployment. The helm chart is here.
  3. Be able to modify markdown links of images to local exported images in their respective page folders for a more complete file level backup.
  4. Be able to pull attachments locally and place in their respective page folders for a more complete file level backup.
  5. Export S3 and more options.
  6. Filter shelves and books by name - for more targeted backups. Example: you only want to share a book about one topic with an external friend/user.
  7. Be able to pull media/photos from 3rd party providers like drawio

Metadata

Release files for bookstack-file-exporter 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bookstack-file-exporter 3.0.0
File Size Uploaded
bookstack_file_exporter-3.0.0.tar.gz 69.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bookstack-file-exporter 3.0.0
File Interpreter ABI Platform
bookstack_file_exporter-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 149.2 kB

Release files / bookstack_file_exporter-3.0.0.tar.gz

Download URL bookstack_file_exporter-3.0.0.tar.gz
Size 69.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fb3d33a4111e26f9a5cbf202d54f5b2e3fb3b770e233b0c1e95a210c6993a94c
BLAKE2b-256 checksum
How to use checksums
a700312f8c2110945903bd060d3ecf1a946fa113d20cf6acb80bd5ecbad47690
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / bookstack_file_exporter-3.0.0-py3-none-any.whl

Download URL bookstack_file_exporter-3.0.0-py3-none-any.whl
Size 79.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40e1dcb3f20893d347b7838066649984c6ad80df464ded08df1cba642e55f83c
BLAKE2b-256 checksum
How to use checksums
1d04b94880fb59249c1b903536d6e39ec8f7a53205c3ae60876543d90963aa95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page