Wiki source code of Import/Export Tool

Version 13.2 by Sorin Burjan on 2011/07/12

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
Ludovic Dubost 8.1 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
19
Sorin Burjan 13.2 20 [[image:ImportPackageColibri.png||style="border: 1px solid black;"]]
Sorin Burjan 12.2 21
22
Ludovic Dubost 8.1 23 * 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 24 * 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 25 * Click on the Import button. This will import all the selected pages.
Vincent Massol 1.4 26 * 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 27
Sorin Burjan 13.2 28 {{warning}}
29 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 30
Ludovic Dubost 8.1 31 * 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 32 * For Tomcat you set //CATALINA_OPTS// to something like //-Xmx1024m//.
33 {{/warning}}
gus27 1.17 34
Silvia Macovei 11.4 35 = Exporting XWiki pages =
Guillaume Fenollar 6.1 36
Vincent Massol 1.4 37 Prerequisites:
38
Ludovic Dubost 8.1 39 * A configured database and Servlet Container. If you don't have them, see the [[Installation>>AdminGuide.Installation]].
40
Vincent Massol 1.4 41 Follow the steps:
Ludovic Dubost 8.1 42
Vincent Massol 1.4 43 * Ensure your database and container are started
44 * Point your browser to http://localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences
Jean-Vincent Drean 3.1 45 * Click on the Export icon and fill the form
Vincent Massol 1.4 46 * Click on the Export button.
47
Sorin Burjan 13.2 48 [[image:ExportPackageColibri.png||style="border: 1px solid black;"]]
Sorin Burjan 12.2 49
Silvia Macovei 11.4 50 == Customizing a XAR ==
Guillaume Lerouge 1.7 51
Ludovic Dubost 8.1 52 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 53
Guillaume Lerouge 1.8 54 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 55
Guillaume Lerouge 1.8 56 * Unzip the file
57 * Keep the pages you want to put in your archive
58 * Edit package.xml to delete the pages you do not want to be in the archive
Sorin Burjan 13.2 59 * 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 60 * You're done! You can now import this specific set of pages to any XWiki instance.
Vincent Massol 1.9 61
Sorin Burjan 13.2 62 {{info}}
63 In the future XWiki will offer the ability to do selective exports.
64 {{/info}}

Get Connected