HowCanIUpdateXWIKIFromAnOlderVersion
Question | How can I upgrade XWIKI from an older Version? |
Answer |
Answer on myself experience. 1/ re-deploy war (easy part)
2/ import xar (difficulties start here) #!/bin/bash XWIKI_BASE_URL=http://localhost:8080 if [[ $# -ne 2 ]]; then echo usage $0 login password exit 1 fi EXPORT_XAR="?format=xar&name=Current" for page in `jar tvf xwiki-enterprise-wiki-2.0.5.xar | sed -ne "/\/.*xml/{s/.*\s\(\S\+\)\/\(\S\+\).xml/\1.\2/ p}"`; do EXPORT_XAR="${EXPORT_XAR}&pages=${page}" done curl -b cookies.txt -c cookies.txt -d"j_username=$1&j_password=$2&j_rememberme=true&submit=Log-in" ${XWIKI_BASE_URL}/xwiki/bin/loginsubmit/XWiki/XWikiLogin curl -b cookies.txt -c cookies.txt ${XWIKI_BASE_URL}/xwiki/bin/export/Main/WebHome${EXPORT_XAR} -o Current.xar Whatever I used the best diff tool (Beyond Compare IMHO), it is not so easy to check if difference are good or not: I need other way. #!/bin/bash XWIKI_BASE_URL=http://localhost:8080 for page in `jar tvf xwiki-enterprise-wiki-2.0.5.xar | sed -ne "/\/.*xml/{s/.*\s\(\S\+\)\/\(\S\+\).xml/\1\/pages\/\2/ p}"`; do version=`curl -s -b cookies.txt -c cookies.txt ${XWIKI_BASE_URL}/xwiki/rest/wikis/xwiki/spaces/$page | sed -ne "/version/{s/.*version>\(.*\)<\/version.*/\1/ p}"` if [[ $version != "1.1" ]]; then echo $page $version UPDATED fi done
Cool, only 8 updated pages: Main/pages/WebHome 144.1 UPDATED XWiki/pages/XWikiUserSheet 4.1 UPDATED XWiki/pages/XWikiAdminGroup 4.2 UPDATED XWiki/pages/XWikiPreferences 78.1 UPDATED XWiki/pages/LiveTableResults 2.1 UPDATED XWiki/pages/XWikiAllGroup 34.1 UPDATED XWiki/pages/WebPreferences 3.2 UPDATED XWiki/pages/LiveTableResultsMacros 2.1 UPDATED All other pages can be updated without any check :-D
|