Bookstack API and bulk import & export #1782

Closed
opened 2026-02-05 01:51:33 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @suvreal on GitHub (Jul 7, 2020).

Dear BookStack community,
I would like to ask if there is any possible result in bulk export, import and API CRUD to full vertical structure of system. We would be pleasured to use this fantastic wiki running on PhP, MySQL and cURL. Otherwise I would like to ask if there is any other way how to paste circa 100 records to this wiki (MySQL query, API POST in development etc.).

Bartolomej

Originally created by @suvreal on GitHub (Jul 7, 2020). Dear BookStack community, I would like to ask if there is any possible result in bulk export, import and API CRUD to full vertical structure of system. We would be pleasured to use this fantastic wiki running on PhP, MySQL and cURL. Otherwise I would like to ask if there is any other way how to paste circa 100 records to this wiki (MySQL query, API POST in development etc.). Bartolomej
Author
Owner

@ssddanbrown commented on GitHub (Jul 9, 2020):

Hi @suvreal,
Development of the API is underway. Books and Shelves are currently supported. Chapters will be part of v0.30. Pages will likely be added to the API in v0.31.

Some people have had luck directly inserting into the database. This page shows a quick overview of the DB tables for BookStack: https://drawsql.app/templates/diagrams/bookstack-mysql

There are some commands that may help here: https://www.bookstackapp.com/docs/admin/commands/
These ones will in particular help if manually inserting content as you'd need to rebuild the permissions & search systems afterwards:

# Rebuild the search index
# Useful if manually inserting pages into the system
php artisan bookstack:regenerate-search

# Regenerate access permissions - Used mostly in development
php artisan bookstack:regenerate-permissions

Things may be complex if you have images embedded within your existing content, or if your existing content format differs quite a bit to the somewhat flat HTML structure that BookStack stores its content in.

@ssddanbrown commented on GitHub (Jul 9, 2020): Hi @suvreal, Development of the API is underway. Books and Shelves are currently supported. Chapters will be part of v0.30. Pages will likely be added to the API in v0.31. Some people have had luck directly inserting into the database. This page shows a quick overview of the DB tables for BookStack: https://drawsql.app/templates/diagrams/bookstack-mysql There are some commands that may help here: https://www.bookstackapp.com/docs/admin/commands/ These ones will in particular help if manually inserting content as you'd need to rebuild the permissions & search systems afterwards: ``` # Rebuild the search index # Useful if manually inserting pages into the system php artisan bookstack:regenerate-search # Regenerate access permissions - Used mostly in development php artisan bookstack:regenerate-permissions ``` Things may be complex if you have images embedded within your existing content, or if your existing content format differs quite a bit to the somewhat flat HTML structure that BookStack stores its content in.
Author
Owner

@suvreal commented on GitHub (Jul 10, 2020):

Thank you, migh I ask when will the 0.30 and 0.31 updates will be available for production usage?

I was able to create nice joins to export particular vertical structure of given id of shelf, but I would very appreciate it as built in feature: bulk import/ bulk export. The API seemed for me only possible outcome, but I actually need to import pages mainly (for the carried content).

@suvreal commented on GitHub (Jul 10, 2020): Thank you, migh I ask when will the 0.30 and 0.31 updates will be available for production usage? I was able to create nice joins to export particular vertical structure of given id of shelf, but I would very appreciate it as built in feature: bulk import/ bulk export. The API seemed for me only possible outcome, but I actually need to import pages mainly (for the carried content).
Author
Owner

@ssddanbrown commented on GitHub (Jul 11, 2020):

Thank you, migh I ask when will the 0.30 and 0.31 updates will be available for production usage?

I don't know for sure. Was hoping to progress v0.30 this weekend but my vision is currently degraded. At a guess, Maybe about end of July for v0.30, and then a couple of months after for v0.31.

Since the queries here have been answered I'll close this off. Once pages have been added to the API I'll likely allow further issues to be created to suggest and further required API endpoints.

@ssddanbrown commented on GitHub (Jul 11, 2020): > Thank you, migh I ask when will the 0.30 and 0.31 updates will be available for production usage? I don't know for sure. Was hoping to progress v0.30 this weekend but my vision is currently degraded. At a guess, Maybe about end of July for v0.30, and then a couple of months after for v0.31. Since the queries here have been answered I'll close this off. Once pages have been added to the API I'll likely allow further issues to be created to suggest and further required API endpoints.
Author
Owner

@lotfihamid commented on GitHub (Jan 29, 2022):

hi,
I write a python wrapper for bulk import HTML document,
all of docs save in a directory and run my script, it's import all HTML docs to database with your api,
https://github.com/lotfihamid/Bookstack-importdocs
i happy for this.

@lotfihamid commented on GitHub (Jan 29, 2022): hi, I write a python wrapper for bulk import HTML document, all of docs save in a directory and run my script, it's import all HTML docs to database with your api, https://github.com/lotfihamid/Bookstack-importdocs i happy for this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1782