Customizations for XAR Export Using URL Parameters
Last modified by Eleni Cojocariu-testing account on 2026/08/21 17:04
Reference
You can export content in XAR format, but you can also trigger a XAR export by changing the URL of Pages. For example, replacing "/view/" with "/export/", and adding the parameter format=xar will export the entire wiki:
http://server/xwiki/bin/export/Space/Page?format=xar, where "Space" is considered to be the top-level Page of a hierarchy.
The format of an export pattern is:
wikiid:pageFullNamePattern
- wikiid: the name of the wiki from which to get the wiki Pages. It doesn't need to be specified if you're targeting Pages from the current wiki.
- pageFullNamePattern: the full name pattern of the Page is based on an SQL "LIKE" comparator. Remember that the character % must be converted to %25 in a URL.
The URL parameters to customize the export:
| Parameter | Description | Example |
|---|---|---|
| pages | Specifies the Pages to include in the export, using a pattern that matches Page names. You can use multiple Pages parameters, each representing a Page pattern. | &pages=Main.%25 (Exports all Pages from the Main space) |
| excludes | Specifies the Pages to exclude from the export, using a pattern that matches Page names. Each excludes parameter applies to the pages parameter in the same position, so use an empty excludes to keep the order when only a later pages has exclusions. Several Pages excluded from the same pages go into a single excludes value, separated by %26; a Page name that itself contains the & character is encoded %2526. | &excludes=Main.Space1.%25 (Excludes the Pages under the Main.Space1 space) |
| filter | Restricts the export to the Pages kept by an entity tree filter, named by its component hint. The hint to use is installedExtensionDocument, which leaves out the Pages belonging to an installed Extension that hold no nested content Pages, so that only the content of the wiki is exported. A filter counts as a selection on its own, and combined with pages it applies to the patterns whose Page name is %25. | &filter=installedExtensionDocument |
| name | Specifies the name of the exported XAR file. If not specified, backup is used for a whole-wiki export and export for a partial one. | &name=CustomExport.xar |
| description | Specifies the description of the XAR export, which can later be viewed when reimporting into an XWiki instance. | &description=The offices of our company |
| history | Set to true to also export the Page's history. | &history=true |
| attachment_jrcs | With history=true, chooses the format of the attachment history. The default true writes the deprecated JRCS versions element, which an XWiki older than 12.0 can read; false writes the revisions element instead, which is what the "Target XWiki version" setting of the Administration export sends. | &attachment_jrcs=false |
| backup | Set to true to mark the archive as a backup package, so that the XWiki Page author of each Page remains the same as when exported, when reimported into an XWiki instance. | &backup=true |
| author | Specifies the author's name in the XAR export, which can later be viewed when reimporting into an XWiki instance. | &author=John Smith |
| licence | Specifies the license for the XAR export, which can later be viewed when reimporting into an XWiki instance. The parameter uses the British spelling, matching the licence element of the package.xml descriptor; the American spelling is ignored. | &licence=GPL |
| version | Specifies the version of the export to the XAR. | &version=1.0 |
Examples of how to use the parameters:
- Exports all Pages in the current wiki:
http://server/xwiki/bin/export/Space/Page?format=xar&pages=%25.%25 - Exports the Pages Main.WebHome and Blog.WebHome:
http://server/xwiki/bin/export/Space/Page?format=xar&pages=Main.WebHome&pages=Blog.WebHome - Exports all Pages in the Main space except Pages under Main.Space1 space, and all Pages under Other space:
http://server/xwiki/bin/export/Space/Page?format=xar&pages=Main.%25&excludes=Main.Space1.%25&pages=Other.%25 - Exports all Pages in the subwiki:Main space except a Page named subwiki:Main.Excluded&Other and subwiki:Main.WebHome. Both exclusions belong to the same pages parameter, so they are one excludes value joined by %26, and the & of the first Page name is encoded %2526:
http://server/xwiki/bin/export/Space/Page?format=xar&pages=subwiki:Main.%25&excludes=subwiki%3AMain.Excluded%2526Other%26subwiki%3AMain.WebHome - Exports all Pages in the Main space and all in the Other space except Other.Excluded (see the empty excludes for respecting the order):
http://server/xwiki/bin/export/Space/Page?format=xar&pages=Main.%25&excludes=&pages=Other.%25&excludes=Other.Excluded - Exports the whole wiki without the Pages that came with an installed Extension:
http://server/xwiki/bin/export/Space/Page?format=xar&filter=installedExtensionDocument
FAQ
What happens if I don't specify any parameter?
If you don't specify any parameter and just change "/view/" with "/export/": http://server/xwiki/bin/export/Space/Page the entire wiki will be exported in XAR format.