You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Discover and build relationships between Bookstack `Shelves/Books/Chapters/Pages` to create a relational parent-child layout
28
30
- Export Bookstack pages and their content to a `.tgz` archive
29
31
- Additional content for pages like their images and metadata and can be exported
32
+
- The exporter can also [Modify Markdown Files](#modify-markdown-files) to replace image links with local exported image paths for a more portable backup
30
33
- YAML configuration file for repeatable and easy runs
31
34
- Can be run via [Python](#run-via-pip) or [Docker](#run-via-docker)
32
35
- Can push archives to remote object storage like [Minio](https://min.io/)
@@ -244,6 +247,7 @@ More descriptions can be found for each section below:
244
247
| `output_path` | `str` | `false` | Optional (default: `cwd`) which directory (relative or full path) to place exports. User who runs the command should have access to read/write to this directory. If not provided, will use current run directory by default |
245
248
| `assets` | `object` | `false` | Optional section to export additional assets from pages. |
246
249
| `assets.export_images` | `bool` | `false` | Optional (default: `false`), export all images for a page to an `image` directory within page directory. See [Backup Behavior](#backup-behavior) for more information on layout |
250
+
| `assets.modify_markdown` | `bool` | `false` | Optional (default: `false`), modify markdown files to replace image links with local exported image paths. This requires `assets.export_images` to be `true` in order to work. See [Modify Markdown Files](#modify-markdown-files) for more information.
247
251
| `assets.export_meta` | `bool` | `false` | Optional (default: `false`), export of metadata about the page in a json file |
248
252
| `assets.verify_ssl` | `bool` | `false` | Optional (default: `true`), whether or not to check ssl certificates when requesting content from Bookstack host |
249
253
| `keep_last` | `int` | `false` | Optional (default: `None`), if exporter can delete older archives. valid values are:<br>- set to `-1` if you want to delete all archives after each run (useful if you only want to upload to object storage)<br>- set to `1+` if you want to retain a certain number of archives<br>- `0` will result in no action done |
@@ -261,9 +265,12 @@ General
261
265
- `MINIO_ACCESS_KEY`
262
266
- `MINIO_SECRET_KEY`
263
267
264
-
### Backup Behavior
268
+
## Backup Behavior
269
+
270
+
### Export File
265
271
Backups are exported in `.tgz` format and generated based off timestamp. Export names will be in the format: `%Y-%m-%d_%H-%M-%S`(Year-Month-Day_Hour-Minute-Second). *Files are first pulled locally to create the tarball and then can be sent to object storage if needed*. Example file name: `bookstack_export_2023-09-22_07-19-54.tgz`.
266
272
273
+
### General
267
274
The exporter can also do housekeeping duties and keep a configured number of archives and delete older ones. See `keep_last` property in the [Configuration](#options-and-descriptions) section. Object storage provider configurations include their own `keep_last` property for flexibility.
268
275
269
276
For file names, `slug` names (from Bookstack API) are used, as such certain characters like `!`, `/` will be ignored and spaces replaced from page names/titles.
@@ -349,6 +356,37 @@ Empty/New Pages will be ignored since they have not been modified yet from creat
349
356
350
357
You may notice some directories (books) and/or files (pages) in the archive have a random string at the end, example - `nKA`: `user-and-group-management-nKA`. This is expected and is because there were resources with the same name created in another shelve and bookstack adds a string at the end to ensure uniqueness.
351
358
359
+
### Images
360
+
361
+
### General
362
+
Images will be dumped in a separate directory, `images` within the page directory it belongs to. As shown earlier:
> **Note you may see old images in your exports. This is because, by default, Bookstack retains images/drawings that are uploaded even if no longer referenced on an active page. Admins can run `Cleanup Images` in the Maintenance Settings or via [CLI](https://www.bookstackapp.com/docs/admin/commands/#cleanup-unused-images) to remove them.
372
+
373
+
### Modify Markdown Files
374
+
**To use this feature, `assets.export_images` should be set to `true`**
375
+
376
+
The configuration item, `assets.modify_markdown`, can be set to `true` to modify markdown files to replace image url links with local exported image paths. This feature allows for you to make your `markdown` exports much more portable.
377
+
378
+
Page (parent) -> Images (Children) relationships are created and then each image url is replaced with its own respective local export path. Example:
This allows the image to be found locally within the export files and allow your `markdown` docs to have all the images display properly like it would normally would.
387
+
388
+
**Note: This will work properly if your pages are using the notation used by Bookstack for Markdown image links, example: ` [](anchor/url link)` The `(anchor/url link)` is optional.**
389
+
352
390
## Object Storage
353
391
Optionally, target(s) can be specified to upload generated archives to a remote location. Supported object storage providers can be found below:
0 commit comments