Customizations for XAR Export Using URL Parameters
Last modified by Eleni Cojocariu on 2026/03/19 08:02
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 enitre 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 specifed 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. You can use multiple Excludes parameters. All special characters must be encoded in the URL. | &excludes=Main.%25 (Excludes Pages from the Main space) | |
| name | Specifies the name of the exported XAR file. If not specified, a default name will be used. | &name=CustomExport.xar | |
| history | If defined, then also export the Page's history. | &history=true | |
| backup | If defined, 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 | |
| license | Specifies the license for the XAR export, which can later be viewed when reimporting into an XWiki instance. | &license=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:
http://server/xwiki/bin/export/Space/Page?format=xar&pages=subwiki:Main.%25&excludes=subwiki%3AMain.Excluded%26Other&subwiki%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
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.