Wiki source code of Import/Export Tool

Version 15.3 by Silvia Macovei on 2012/03/19

Hide last authors
Sorin Burjan 13.2 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
Vincent Massol 1.1 4
Silvia Macovei 11.4 5 These tools allow 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 very useful for backing up your wiki and for restoring a wiki from scratch (see also the [[Backup guide>>Backup]] for more information on backups).
Vincent Massol 1.1 6
Silvia Macovei 11.4 7 = Importing XWiki pages =
Vincent Massol 1.3 8
Vincent Massol 1.1 9 Prerequisites:
10
Ludovic Dubost 8.1 11 * A configured database and Servlet Container. If you don't have them, see the [[Installation guide>>AdminGuide.Installation]].
12
Vincent Massol 1.1 13 Follow the steps:
Ludovic Dubost 8.1 14
Vincent Massol 1.4 15 * Ensure your database and container are started
Vincent Massol 14.2 16 * Point your browser to ##http:~//localhost:8080/xwiki/bin/import/XWiki/XWikiPreferences## or click on the "Administration" link in the top right (if you're using the [[Albatross>>platform:Features.Skins]] or [[Toucan>>platform:Features.Skins]] skin)
Jean-Vincent Drean 3.1 17 * Click on the Import icon. You should see the following screen:
Vincent Massol 1.1 18
Silvia Macovei 15.3 19 {{image reference="ImportPackageColibri.png"/}}
Vincent Massol 1.1 20
Ludovic Dubost 8.1 21 * Attach the XAR file you wish to import and then **select it in the list**. After a few seconds you should see the list of all the pages in your XAR listed and selected by default (unselect if you wish not to import some pages).
Jeremie Bousquet 1.19 22 * Select option "with history" if you want to preserve imported pages history. If not checked newly imported pages will have revision "1.1".
Vincent Massol 1.1 23 * Click on the Import button. This will import all the selected pages.
Vincent Massol 1.4 24 * 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.
Vincent Massol 1.1 25
Sorin Burjan 13.2 26 {{warning}}
27 If you get a 'Java heap space Out Of Memory exception' you'll need to increase the memory allocated to the JVM running XWiki. How you do this depends on the container you use.
Vincent Massol 1.13 28
Ludovic Dubost 8.1 29 * For Jetty you edit a line in start_xwiki.bat (or start_xwiki.sh) from //JAVA_OPTS=-Xmx300m// to something like //JAVA_OPTS=-Xmx1024m//
Sorin Burjan 13.2 30 * For Tomcat you set //CATALINA_OPTS// to something like //-Xmx1024m//.
31 {{/warning}}
gus27 1.17 32
Silvia Macovei 11.4 33 = Exporting XWiki pages =
Guillaume Fenollar 6.1 34
Vincent Massol 1.4 35 Prerequisites:
36
Ludovic Dubost 8.1 37 * A configured database and Servlet Container. If you don't have them, see the [[Installation>>AdminGuide.Installation]].
38
Vincent Massol 1.4 39 Follow the steps:
Ludovic Dubost 8.1 40
Vincent Massol 1.4 41 * Ensure your database and container are started
Vincent Massol 14.2 42 * Point your browser to ##http:~//localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences##
Jean-Vincent Drean 3.1 43 * Click on the Export icon and fill the form
Vincent Massol 1.4 44 * Click on the Export button.
45
Silvia Macovei 15.3 46 {{image reference="ExportPackageColibri.png"/}}
Sorin Burjan 12.2 47
Silvia Macovei 11.4 48 == Customizing a XAR ==
Guillaume Lerouge 1.7 49
Ludovic Dubost 8.1 50 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.
Guillaume Lerouge 1.7 51
Guillaume Lerouge 1.8 52 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:
Ludovic Dubost 8.1 53
Guillaume Lerouge 1.8 54 * Unzip the file
55 * Keep the pages you want to put in your archive
56 * Edit package.xml to delete the pages you do not want to be in the archive
Sorin Burjan 13.2 57 * 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.
Guillaume Lerouge 1.8 58 * You're done! You can now import this specific set of pages to any XWiki instance.
Vincent Massol 1.9 59
Sorin Burjan 13.2 60 {{info}}
Vincent Massol 14.1 61 In the future XWiki will offer the ability to do selective exports natively. For the moment you'll need to install the [[Multipage Export Extension>>extensions:Extension.Multipage Export Application]].
Sorin Burjan 13.2 62 {{/info}}

Get Connected