[PR #5592] [MERGED] API: Add endpoints for import/export #6525

Closed
opened 2026-02-05 10:34:41 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/5592
Author: @LM-Nishant
Created: 4/25/2025
Status: Merged
Merged: 7/18/2025
Merged by: @ssddanbrown

Base: developmentHead: development


📝 Commits (3)

  • c61ce8d Implement functionality to export a book, along with its pages and chapters, as a ZIP file.
  • 5fa728f Develop functionality to import ZIP files. Create an API controller and define a route entry for handling the import process. Implement logic to read the list of files within the ZIP, process the directory structure, and automatically create associated pages, chapters, and books based on the ZIP file's contents.
  • 64da80c added routes for zip export

📊 Changes

5 files changed (+171 additions, -3 deletions)

View changed files

📝 app/Exports/Controllers/BookExportApiController.php (+17 -1)
📝 app/Exports/Controllers/ChapterExportApiController.php (+11 -1)
app/Exports/Controllers/ImportApiController.php (+121 -0)
📝 app/Exports/Controllers/PageExportApiController.php (+13 -1)
📝 routes/api.php (+9 -0)

📄 Description

While working on my project, I extensively utilized BookStack as a central platform for organizing and managing content. During development, I identified the need for additional functionality to export and import books, along with their pages and chapters, as ZIP files. This would streamline data portability and enable seamless integration of BookStack content into other workflows.
To address this requirement, I implemented the following features:

  • Export functionality: Allows users to package a book, its pages, and chapters into a single ZIP file for download.
  • Import functionality: Provides the ability to upload ZIP files, automatically processing the directory structure to recreate books, pages, and chapters within BookStack.

This contribution aims to enhance BookStack’s usability by improving content sharing and migration capabilities.
Let me know if you'd like adjustments or additional details!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/5592 **Author:** [@LM-Nishant](https://github.com/LM-Nishant) **Created:** 4/25/2025 **Status:** ✅ Merged **Merged:** 7/18/2025 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `development` --- ### 📝 Commits (3) - [`c61ce8d`](https://github.com/BookStackApp/BookStack/commit/c61ce8dee4ea474b16564c3d3337bac25fba1f46) Implement functionality to export a book, along with its pages and chapters, as a ZIP file. - [`5fa728f`](https://github.com/BookStackApp/BookStack/commit/5fa728f28a0c4f09649da7b653dd66260e49a596) Develop functionality to import ZIP files. Create an API controller and define a route entry for handling the import process. Implement logic to read the list of files within the ZIP, process the directory structure, and automatically create associated pages, chapters, and books based on the ZIP file's contents. - [`64da80c`](https://github.com/BookStackApp/BookStack/commit/64da80cbf4611f0e6a1700e6e2fa399389ee50da) added routes for zip export ### 📊 Changes **5 files changed** (+171 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `app/Exports/Controllers/BookExportApiController.php` (+17 -1) 📝 `app/Exports/Controllers/ChapterExportApiController.php` (+11 -1) ➕ `app/Exports/Controllers/ImportApiController.php` (+121 -0) 📝 `app/Exports/Controllers/PageExportApiController.php` (+13 -1) 📝 `routes/api.php` (+9 -0) </details> ### 📄 Description While working on my project, I extensively utilized BookStack as a central platform for organizing and managing content. During development, I identified the need for additional functionality to export and import books, along with their pages and chapters, as ZIP files. This would streamline data portability and enable seamless integration of BookStack content into other workflows. To address this requirement, I implemented the following features: - Export functionality: Allows users to package a book, its pages, and chapters into a single ZIP file for download. - Import functionality: Provides the ability to upload ZIP files, automatically processing the directory structure to recreate books, pages, and chapters within BookStack. This contribution aims to enhance BookStack’s usability by improving content sharing and migration capabilities. Let me know if you'd like adjustments or additional details! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:34:41 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6525