Exporting & Importing Content
BookStack allows its content to be exported in a range of formats, while also providing a few options for importing content. Note that these options are not intended for backup or restore, for which you can find relevant documentation here.
Exporting
Within BookStack, if you have the required “Export content” role permission, you can export books, chapters or pages in the following formats:
- Contained Web File
- A “.html” file, with images embedded where possible, which can be opened in a web browser.
- This usually provides the best representation of your BookStack content.
- PDF File
- A “.pdf” document file representation of your content.
- The output of this can sometimes be inaccurate or lack certain features compared to how its represented in BookStack.
- Plain Text File
- A “.txt” file with just the text containing in your content.
- Markdown File
- A “.md” file with a markdown representation of your content.
- If the page was written using the Markdown editor, then that original content will be provided otherwise this export will attempt a conversion to Markdown.
- The resulting markdown may still use HTML for some content types.
- Portable ZIP
- A compressed “.zip” file containing data, attachment and image files.
- This can be re-imported to BookStack instances as mentioned below.
- The exact format can be found documented in the BookStack source here.
Although not shown as an export format, care is taken in BookStack to ensure that pages display well via browser printing options. This allows you to print to paper, or often to PDF, via your browser’s print action as another form of export.
For developers, many of these export options can also be accessed over the BookStack REST API, which also provides many other endpoints that may be found useful for export-focused tasks.
Importing
Within BookStack, if you have the required “Import content” role permission, you can import “Portable ZIP”
files (as mentioned in the exporting section above) via the “Import” action seen when viewing the
top-level “Books” view, or by going to the /import
URL path of your instance:
Here you’ll be able to upload a new ZIP file for import, or continue a previously uploaded pending import. Before the import runs, you’ll be provided a preview of what’s due to be imported. When ran, the content will be imported into BookStack, and the original uploaded ZIP file will be deleted.
For developers, the details of this importable ZIP format can be found here otherwise you could also consider the BookStack REST API as an option for import.