Wiki source code of Import/Export

Version 16.2 by Manuel Smeria on 2012/12/12

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 This feature allows you to export one or several pages from your wiki into a **XAR** file (**X**wiki **AR**chive) 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.
6
7 {{warning}}
8 This feature doesn't replace a [[proper backup>>Backup]].
9 {{/warning}}
10
11 = Importing XWiki pages =
12
13 Prerequisites:
14 * A configured database and Servlet Container. If you don't have them, see the [[Installation guide>>AdminGuide.Installation]].
15
16 Follow these steps:
17 * Ensure your database and container are started
18 * Point your browser to ##http:~//localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences## or hover over "Wiki" and click on "Administer Wiki"
19 * Click on "Import"
20 * 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):
21
22 {{image reference="ImportPackageColibri.png"/}}
23
24 * 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"
25 * Click "Import". This will import all the selected pages
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.
27 (((
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:
30 * For Jetty you must change a line in ##start_xwiki.bat## (or ##start_xwiki.sh##) from //JAVA_OPTS=-Xmx300m// to something like //JAVA_OPTS=-Xmx1024m//
31 * For Tomcat you must set //CATALINA_OPTS// to something like //-Xmx1024m//
32 {{/warning}}
33 )))
34
35 = Exporting XWiki pages =
36
37 Prerequisites:
38 * A configured database and Servlet Container. If you don't have them, see the [[Installation guide>>AdminGuide.Installation]].
39
40 Follow these steps:
41 * Ensure your database and container are started
42 * Point your browser to ##http:~//localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences##
43 * Click "Export" and fill the form
44 * Click "Export"
45
46 {{image reference="ExportPackageColibri.png"/}}
47
48 == Customizing a XAR ==
49
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.
51
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:
53 * Unzip the file
54 * Keep the pages you want to put in your archive
55 * Edit ##package.xml## to delete the pages you do not want to be in the archive
56 * 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
57 * You're done! You can now import this specific set of pages to any XWiki instance
58
59 {{info}}
60 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]].
61 {{/info}}

Get Connected