Upgrading the demo package
Last modified by Vincent Massol on 2024/04/02
- If you've installed the standard distribution (zip or jar distribution) and you wish to upgrade it, the simplest is to download the new version and install it as you did the first time. Just make sure you don't install the new version over the old one (both installations need to exist).
- Then copy the configuration files and the permanent directory from the old installation to the new one. Ideally you should not copy over the configuration files exactly since the new version could have added new configuration options and thus ideally you should do a merge instead of a pure copy. Another strategy is to use the new configuration files, not copy over the old configuration files and instead manually edit the new configuration to make the same changes as you have may done before (If you've never touched the configuration files then there's nothing to do obviously!).
If you're on a unix system here are some commands that may help you doing the merge instead of doing it fully manually:
## Note: We're assuming that "xwiki.new" is a symbolic link that points to the location
## where the new xwiki version is located and that "xwiki" is the location of the previous
## xwiki installation.
mv xwiki.new/WEB-INF/web.xml xwiki.new/WEB-INF/web.xml.ori; sudo sdiff xwiki/WEB-INF/web.xml xwiki.new/WEB-INF/web.xml.ori -B -W -E -o xwiki.new/WEB-INF/web.xml
mv xwiki.new/WEB-INF/xwiki.cfg xwiki.new/WEB-INF/xwiki.cfg.ori; sudo sdiff xwiki/WEB-INF/xwiki.cfg xwiki.new/WEB-INF/xwiki.cfg.ori -B -W -E -o xwiki.new/WEB-INF/xwiki.cfg
mv xwiki.new/WEB-INF/xwiki.properties xwiki.new/WEB-INF/xwiki.properties.ori; sudo sdiff xwiki/WEB-INF/xwiki.properties xwiki.new/WEB-INF/xwiki.properties.ori -B -W -E -o xwiki.new/WEB-INF/xwiki.properties
mv xwiki.new/WEB-INF/struts-config.xml xwiki.new/WEB-INF/struts-config.xml.ori; sudo sdiff xwiki/WEB-INF/struts-config.xml xwiki.new/WEB-INF/struts-config.xml.ori -B -W -E -o xwiki.new/WEB-INF/struts-config.xml
mv xwiki.new/WEB-INF/classes/logback.xml xwiki.new/WEB-INF/classes/logback.xml.ori; sudo sdiff xwiki/WEB-INF/classes/logback.xml xwiki.new/WEB-INF/classes/logback.xml.ori -B -W -E -o xwiki.new/WEB-INF/classes/logback.xmlNote that the database schema is automatically upgraded when needed. All you need to do is to ensure your xwiki.cfg file is correctly configured to perform the migration. Here's a relevant excerpt from the xwiki.cfg file:
#-# Whether migrations are enabled or not. Should be enabled when upgrading, but for a better startup time it is better to
#-# disable them in production.
xwiki.store.migration=1
#-# Whether to exit after migration. Useful when a server should handle migrations for a large database, without going
#-# live afterwards.
# xwiki.store.migration.exitAfterEnd=0
#-# Indicate the list of databases to migrate.
#-# to upgrade all wikis database set xwiki.store.migration.databases=all
#-# to upgrade just some wikis databases set xwiki.store.migration.databases=xwiki,wiki1,wiki2
#-# Note: the main wiki is always migrated whatever the configuration.
# xwiki.store.migration.databases=