BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

Add System Import/Export

Open ssddanbrown opened this issue 9 years ago • 42 comments

ssddanbrown avatar Jan 13 '16 22:01 ssddanbrown

Adding support for this feature. The export ability for single pages is great, but being able to export an entire book or chapter to PDF/HTML/TXT (or even EPUB directly) would be fantastic and could really expand the usecases of the software.

davidtorcivia avatar May 07 '16 03:05 davidtorcivia

Related with #177 for export whole book.

Anyway, I would like a feature to bulk-import pages from... (in our case) github wiki pages (a bunch of markdown files)

patoroco avatar Dec 27 '16 17:12 patoroco

Markdown export would be great if it's possible for that to be incorporated at some point?

viewty avatar Jul 13 '17 12:07 viewty

Currently I am using md text files and I am testing bookstack, it would be awsome to import all files from directory as pages.

terxw avatar May 13 '18 17:05 terxw

Any chances for this to get done? Migration scenarios are currently not possible, which means that BookStack missing out on all those businesses around with existing wikis.

Leon99 avatar Oct 23 '18 02:10 Leon99

.md import would be great as a starting point for migration. PDF export of shelves would also be great.

brutecode avatar Oct 25 '18 07:10 brutecode

+1 for importing .md

edenpc avatar Jan 11 '19 10:01 edenpc

I agree, importing would be great. I'm currently importing a lot of notes by hand. It's sort of a good thing since I have to go through all them but honestly if given the choice I would've just uploaded them. I converted them from org-mode to html with pandoc. Works quite well when I paste the code directly into the source editor.

Nebucatnetzer avatar Feb 05 '19 18:02 Nebucatnetzer

Good day guys. Is it possible to import data from confluence? If so, how to do it

Kazakhstanec94 avatar Feb 19 '19 07:02 Kazakhstanec94

Is it possible to get an update on if an import is on the roadmap?

oden08 avatar Mar 28 '19 13:03 oden08

@oden08 Import is correctly not on the roadmap itself.

To be honest, "Import" as a feature request on its own is way too generic. The are many different formats or systems people will be looking to import from that we can't really just have a generic "Import" option. I initially opened this issue envisioning this to be a way to backup/restore a BookStack instance although I've had trouble seeing how we could achieve this as reliably as the current MySQL dump option.

On the roadmap is a REST API. For importing from other formats or systems, I imagine the best way forward will be for people to write scripts or applications to import into BookStack using the API. That way the BookStack project itself does not have to maintain a whole bunch of import logic.

That's how I see things moving forward.

ssddanbrown avatar Mar 28 '19 19:03 ssddanbrown

@ssddanbrown any chances for markdown import, being the most requested approach (which kind of makes sense, given that most wiki systems support it one way or another), implemented by you?

Leon99 avatar Mar 29 '19 03:03 Leon99

In the mean time, I'd be content hacking together my own import solution, but I get "Page not found" when I do the following:

  • add shelves, books, chapters, pages, e.g.:
INSERT INTO `pages` VALUES (NULL,1,0,'title here','slug-here','<p id=\"bkmrk-text-here\">text here</p>','text here',5,'2019-06-04 15:55:55','2019-06-04 15:55:55',1,1,0,0,'text here',1)
  • rebuild the search index - see docs and issue #974

What else is needed?

bitinerant avatar Jun 04 '19 19:06 bitinerant

@bitinerant Try running php artisan bookstack:regenerate-permissions. Think the permission index just needs to be updated.

ssddanbrown avatar Jun 04 '19 20:06 ssddanbrown

Thank you, sir! That did it. :-)

bitinerant avatar Jun 04 '19 20:06 bitinerant

Given the markdown, how can I generate the html and plain text to insert into the pages table, preferably from the command-line? Or, how can I refresh these 2 fields in the entire table? I've been searching all over for what should be really simple, but I don't know PHP or JavaScript.

bitinerant avatar Jun 05 '19 17:06 bitinerant

@bitinerant Currently the markdown conversion to HTML is performed client side so there's no back-end systems to do this. You'd have to convert before sending in manually.

The conversion to plaintext is done at the following location: https://github.com/BookStackApp/BookStack/blob/v0.26.2/app/Entities/Repos/PageRepo.php#L213-L217

The plaintext generation is not available via command-line or anything at this time.

ssddanbrown avatar Jun 06 '19 13:06 ssddanbrown

Thanks a lot, Dan. I'll either write a script to do a null edit on every page from the client, or use something like Pandoc.

bitinerant avatar Jun 06 '19 15:06 bitinerant

@bitinerant Pandoc sounds like a great idea! How far are you with your mitigation/convertion script? As I am writing something similar and don't want to duplicate efforts :)

wizofe avatar Jul 04 '19 13:07 wizofe

@wizofe - other projects preempted this, so I'm not too far yet. What wiki are you converting from and what language are you writing the conversion in? For me this is DokuWiki and Python.

So far I have several regular expressions to 'fix' Pandoc's incomplete DokuWiki support, the Pandoc conversion (markdown = pypandoc.convert(dokuwiki, format="dokuwiki", to="commonmark+pipe_tables+backtick_code_blocks", extra_args=["--atx-headers", "--wrap=none"])), and then several regular expressions to personalize the markdown. In the near future I hope to finish my regular expressions, generate html with Pandoc (should be trivial), and convert old revisions (history).

I'd be happy to coordinate on parts of the development if it makes sense.

bitinerant avatar Jul 04 '19 15:07 bitinerant

Hi guys, I have a bookstack setup with one shelf per group I'm helping, after I complete the initial documentation for them and get a go ahead, I create their own bookstack server and manually copy their content page by page.

Is there no chance of having an export/import or migrate shelf to another bookstack instance feature?

openmoto avatar Jul 10 '19 13:07 openmoto

@openmoto Not right now. Could probably do some creating scripting to achieve what you're doing. Uploaded images could make things tricky though.

As per this comment above, An API is upcoming on the roadmap which will make scripting this kind of thing easier.

ssddanbrown avatar Jul 10 '19 19:07 ssddanbrown

Import from Mindtouch DekiWiki would be awsome.

OlofBailey avatar Feb 15 '20 14:02 OlofBailey

any updates on the rest api or the possibility to export a whole shelf? :)

Smoin1 avatar May 02 '20 18:05 Smoin1

Hi @Smoin1, The API has been started, you can find documentation at <your_bookstack_url>/api/docs, You'll need the "Access system API" permission for this. API endpoints are being expanded on each release.

No updates on shelf exports.

ssddanbrown avatar May 05 '20 18:05 ssddanbrown

Atlassian drops support of self-hosted Confluence, any chances to create a painless migration scenario to bookstack?

b0r1sp avatar Nov 25 '20 15:11 b0r1sp

@b0r1sp I'm not looking to include any platform specific (Including confluence) migration/import/export logic within the core project itself. I'm just finishing up the core parts of the API though so things will become easier for others to make such a process. Depending on availability I may contribute to that myself but I'm not familiar with the specific workings of confluence so I'd rather someone with confluence experience led such a task.

ssddanbrown avatar Nov 25 '20 23:11 ssddanbrown

I would also love to see exporting and importing functionality added to BookStack in a format of which BookStack can easily interpret on the import. For example, lets say I have a instance with various shelves and books in. It would be desirable to be able to export a whole book (images and all) in a BookStack friendly format and then that export dump could be used in conjunction with a clean BookStack instance, and on the import process if it is in a nice forma it could understand it would be great if it had a import wizard which actually asked you interactively what data you wished to import, giving you the choice of the whole book, or select specific chapters or pages only etc.

I know its very easy to request such features but potentially a nightmare to try and build them (I'm incapable of doing such things myself) so I want to thank you for what we do have! And thank any contributors that work towards this feature.

ashleycawley avatar Feb 19 '21 15:02 ashleycawley

+1 for this feature exactly as @ashleycawley described it. Much thanks to ssddabrown for this awesome project! Perhaps a bounty for such features to keep the developer(s) motivated?

lieszkol avatar Feb 22 '21 18:02 lieszkol

+1 as request for import

Thanks for export ;)

dawidmachon avatar Oct 25 '21 22:10 dawidmachon