Hide last authors
Sorin Burjan 13.2 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
Vincent Massol 1.1 4
Vincent Massol 31.3 5 This feature allows you to export one or several pages from your wiki into a [[**XAR** file>>extensions:Extension.XAR Module Specifications]] (**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.
Vincent Massol 1.1 6
Manuel Smeria 16.2 7 {{warning}}
8 This feature doesn't replace a [[proper backup>>Backup]].
9 {{/warning}}
Vincent Massol 16.1 10
Silvia Macovei 11.4 11 = Importing XWiki pages =
Vincent Massol 1.3 12
Vincent Massol 1.1 13 Prerequisites:
Thomas Mortagne 27.1 14
Ecaterina Moraru (Valica) 30.4 15 * {{info}}New in XWiki 5.0+{{/info}} If your wiki is empty and this is your first import, you will need [[to log in as ##superadmin##>>Documentation.AdminGuide.Configuration#HEnablesuperadminaccount]] to do the first import since there are no users defined in the wiki at this time.
16 * A configured database and Servlet Container. If you don't have them, see the [[Installation guide>>Documentation.AdminGuide.Installation]].
Ludovic Dubost 8.1 17
Manuel Smeria 16.2 18 Follow these steps:
Dmitry Bakbardin 18.1 19
Vincent Massol 1.4 20 * Ensure your database and container are started
Vincent Massol 31.2 21 * Got the Administration page (top right Drawer menu) of your wiki and then find the Import menu.
22 ** Alternatively you can point your browser to ##http:~/~/localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences##
Dmitry Bakbardin 18.1 23 * 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):(((
Thomas Mortagne 30.1 24 {{image reference="importpage.png"/}}
Manuel Smeria 17.2 25 )))
Manuel Smeria 16.2 26 * 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"
AutomationX 31.1 27 * In case you want to preserve the author for the imported pages, check the "Import as backup package" option.
Manuel Smeria 16.2 28 * Click "Import". This will import all the selected pages
Vincent Massol 1.4 29 * 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.
Manuel Smeria 17.2 30
Dmitry Bakbardin 18.1 31 {{info}}
Dmitry Bakbardin 19.1 32 If you own the sub-wiki (virtual wiki, wiki-farm), you need to be sure that you either:
33 * install with a global user having Programming Rights (PR) and UNCHECK the backup pack option
34 * install with a global user having PR and keep the backup pack option but in this case MAKE SURE that the user defined in the XAR exists and has PR.
35 Otherwise all imported pages would be saved without PR and scripts won't work until you resave them under the user with Programming Rights .
Dmitry Bakbardin 18.1 36
37 Note, that pages requiring PR are supposed to also contain a XWiki.RequiredRightClass xobject so it should be easy to query them. If you find some that don't have this XObject please let us know. This XObject is just indicative and doesn't change permissions.
38 {{/info}}
Sorin Burjan 13.2 40 {{warning}}
Manuel Smeria 16.2 41 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:
42 * 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//
43 * For Tomcat you must set //CATALINA_OPTS// to something like //-Xmx1024m//
Sorin Burjan 13.2 44 {{/warning}}
gus27 1.17 45
Vincent Massol 25.1 46 == Importing an Extension ==
48 When you import a XAR, if the XAR's ##package.xml## contains an ##extensionId## value (representing an Extension Id) then the Importer will check if the Extension exists in its configured XWiki Extension Repositories (the configuration for this is located in ##xwiki.properties## under the ##extension.repositories## keys). If the Extension is found, the Importer will then register it in the list of installed Extensions that you can see when going to the [[Extension Manager Application's UI>>extensions:Extension.Extension Manager Application]].
Silvia Macovei 11.4 50 = Exporting XWiki pages =
Guillaume Fenollar 6.1 51
Vincent Massol 1.4 52 Prerequisites:
Dmitry Bakbardin 18.1 53
Ecaterina Moraru (Valica) 30.4 54 * A configured database and Servlet Container. If you don't have them, see the [[Installation guide>>Documentation.AdminGuide.Installation]].
Vincent Massol 1.4 55
Manuel Smeria 16.2 56 Follow these steps:
Dmitry Bakbardin 18.1 57
Vincent Massol 1.4 58 * Ensure your database and container are started
Dmitry Bakbardin 18.1 59 * Point your browser to ##http:~/~/localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences##
Manuel Smeria 16.2 60 * Click "Export" and fill the form
Dmitry Bakbardin 18.1 61 * Click "Export"(((
Silvia Macovei 24.1 62 {{image reference="ExportPackageFlamingo.png"/}}
Manuel Smeria 17.2 63 )))
Dmitry Bakbardin 18.1 64
Silvia Macovei 11.4 65 == Customizing a XAR ==
Guillaume Lerouge 1.7 66
Ecaterina Moraru (Valica) 30.4 67 When doing an export, XWiki pages are saved using the [[XAR format>>Documentation.AdminGuide.ImportExport||anchor="HXARFormat"]]. A typical XAR created when doing an export will include all the pages on your XWiki instance. However you can [[control this using a custom Export URL>>platform:Features.Exports||anchor="HXARExport"]].
Guillaume Lerouge 1.7 68
Vincent Massol 26.1 69 That said, it is also possible 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 for example. Here are the steps:
Dmitry Bakbardin 18.1 70
Guillaume Lerouge 1.8 71 * Unzip the file
72 * Keep the pages you want to put in your archive
Manuel Smeria 16.2 73 * Edit ##package.xml## to delete the pages you do not want to be in the archive
74 * 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
75 * You're done! You can now import this specific set of pages to any XWiki instance
Vincent Massol 1.9 76
Sorin Burjan 13.2 77 {{info}}
Vincent Massol 14.1 78 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 79 {{/info}}
Vincent Massol 26.1 80
Vincent Massol 26.2 81 = XAR Format =
Vincent Massol 26.1 82
Thomas Mortagne 28.1 83 See [[XAR Format specifications>>extensions:Extension.XAR Module Specifications]].

Get Connected