How to bulk export all pages in Xwiki to either docx, markdown or plain text

I have decided to stop using Xwiki for a site that has been generating pages over de last few months. The main reason is that batch import batch export functionality to common text formats appears difficult for users (including myself), and connectivity with other third party apps is very limited.
Still, I need to get all content out and move it elsewhere, using either docx, markdown or plain text. Who may assist with this? Thanks!

Wishing everyone a happy ending and new year. I’m still wondering about this issue, if anyone has a clue?

Hi. XWiki supports several exports by default Exports (XWiki.org)

However with the XAR export (for ex), you’ll get non-rendered content written in the syntax of each page. The HTML export will give you HTML.

There’s no OOB extension that will do what you want (ie get the whole content as docx, markdown or plain text). However XWiki has support to convert content from one syntax to another, see “output syntax” at XWiki Rendering Framework (XWiki.org)

So you could write a script that does the following:

  • Use the Query script service to find the pages to export
  • Then iterate on them, get their content and for each content convert it to the format you want in output (say markdown for ex), using the rendering script service (see Rendering Module (XWiki.org)).
  • Then save the content somewhere (either on the file system, you’ll need to use the groovy macro for that, or in some wiki pages in a different tree for ex which you’ll then get using a XAR export).

Hope that helps