Old XWiki Migration Guide

Last modified by Guillaume Sauthier on 2012/12/10 11:25

Build a list of all pages of the wiki

Create a new page on the wiki with the following content:

1 All Documents of this Wiki
#macro( cleanup $message )$message.replaceAll(" ", "+").replaceAll("/", "%2F")#end

#set ($sql = "where 1=1 order by doc.web, doc.name")
#foreach ($item in $xwiki.searchDocuments($sql))
#set($bentrydoc = $xwiki.getDocument($item))
#cleanup(${bentrydoc.web})/#cleanup(${bentrydoc.name})
##'${bentrydoc.web}' '${bentrydoc.name}' -> [${bentrydoc.web}.${bentrydoc.name}]##
#end

That will list all the pages of your wiki in a usable fashion:

+Cookbooks/Multitenancy+context
+Cookbooks/Multitenancy+Demonstration
+Cookbooks/Multitenancy+MultitenantService
+Cookbooks/Multitenancy+prototype
+Cookbooks/Multitenancy+todo
+Doc/Migration
AutoStart/demo
AutoStart/FlexExample
AutoStart/MavenExample
AutoStart/Starter

...

AutoStart/SwingExample
AutoStart/WebHome
Blog/Categories
Blog/Category
Blog/Macros

Copy paste this content in a local file.

Compilation

The process is partially implemented in Java (the part inlining the attachments).
So you need to compile the maven project:

$ git clone git://gitorious.ow2.org/ow2/legacy-xwiki-exporter.git
$ cd legacy-xwiki-exporter
$ mvn clean install

Usage

$ export-content jonas < /tmp/jonas-web/test-pages.lst

You should see something like this :

Step 1. Importing raw XWiki Pages
----
Downloading Cookbooks/Running+JOnAS+on+Windows+Azure ...
Step 2. Inline XWiki Page attachments
----
Processing target/export/Cookbooks/Running+JOnAS+on+Windows+Azure.xml
 Downloading windows_azure_logo.jpg
 Downloading banner_e4sl.png
Step 3. Create XWiki XAR
----
Wiki 'jonas' has been exported in 'target/jonas-export.xar'

Important

Notice that you can comment lines in your pages list.
It is considered a good habit to not export XWiki/* pages

Final Steps

Gives that XAR archive to the XWiki administrator, he will install your old content within a fresh new XWiki instance.

When this is done, you have to browse the new web site and check that everything is OK.

Get Involved

Share technical know how with other users, and help to promote OW2

TC Live

 

 

Powered by XWiki Hosted by Xsalto Free PageRank Checker Creative Commons 2.0 license Legal Notice