Import/Export
This feature allows you to export one or several pages from your wiki into a XAR file (XWiki ARchive) or to import one or several pages from an existing XAR file. This is useful for moving wiki pages from one instance to another or to perform lightweight backup of your wiki pages.
Importing XWiki pages
Prerequisites:
- to log in as superadmin to do the first import since there are no users defined in the wiki at this time. If your wiki is empty and this is your first import, you will need
- A configured database and Servlet Container. If you don't have them, see the Installation guide.
Follow these steps:
- Ensure your database and container are started
- Point your browser to http://localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences or hover over "Wiki" and click on "Administer Wiki"
- Click on "Import"
- Attach the XAR file you wish to import and then select it from the list under "Available packages". After a few seconds you should see the list of all the pages in your XAR listed and selected by default (unselect the pages/folders you don't wish to import):
- Select the second radio button if you want to replace the document history with the history from the imported package. If you don't select it the newly imported pages will have the revision "1.1"
- Click "Import". This will import all the selected pages
- At this stage your rights might have been changed as the import may have imported different rights. You may need to log out and log in again.
Exporting XWiki pages
Prerequisites:
- A configured database and Servlet Container. If you don't have them, see the Installation guide.
Follow these steps:
- Ensure your database and container are started
- Point your browser to http://localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences
- Click "Export" and fill the form
- Click "Export"
Customizing a XAR
When doing an export, XWiki pages are saved using the XAR format. This is in fact a renamed ZIP format with a package.xml file containing metadata about the export. A typical XAR created when doing an export will include all the pages on your XWiki instance.
It is possible however to create a XAR that will include only the pages you want. This is useful when you want to export only the pages of a specific application. Here are the steps:
- Unzip the file
- Keep the pages you want to put in your archive
- Edit package.xml to delete the pages you do not want to be in the archive
- Zip together the modified package.xml file and the pages you want to put together in your archive, naming the file "MyArchive".xar where "MyArchive" is the actual name you want to give it
- You're done! You can now import this specific set of pages to any XWiki instance