Upgrading the WAR

Last modified by Vincent Massol on 2024/04/02

  • The general strategy is to download the new WAR distribution and to replace your current installed WAR with it. However make sure you don't copy on top since this could leave some old files around which would make XWiki fail (like if old JARs are lying around in WEB-INF/lib). In addition you would override some XWiki configuration files located in WEB-INF (xwiki.properties and xwiki.cfg to name just two).
  • Thus, before replacing your current WAR, make sure you back it up, including configuration and data files.
  • Also you need to ensure that you use the same XWiki Permanent directory (configured in WEB-INF/xwiki.properties using the environment.permanentDirectory property).
  • Some additional operations may be required for upgrading and you must check the release notes for all the versions from the version you're upgrading from up to the new version you're installing. It's also possible that new features are available and that some configuration files need to be modified. If this is the case then it'll be specified in the release notes.
  • Note 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=
    Warning

    From a failed migration the database tables DATABASECHANGELOG and DATABASECHANGELOGLOCK may be left over.
    Ensure that these tables are dropped before restarting a failed migration.

  • Invalid Extensions

    Also note that when you upgrade, some extensions that were previously valid may become invalid  (for example they may have been renamed, removed or have versions that do not match the version of the WAR you've installed as is the case with the example below). In this case you'll see in the console messages such as:

    2013-12-02 11:43:01,688 [localhost-startStop-1] WARN  ltInstalledExtensionRepository - Invalid extension [org.xwiki.enterprise:xwiki-enterprise-ui-common-5.2.1] on namespace [wiki:xwiki]
    2013-12-02 11:43:01,688 [localhost-startStop-1] WARN  ltInstalledExtensionRepository - Invalid extension [org.xwiki.platform:xwiki-platform-workspace-ui-5.2.1] on namespace [wiki:xwiki]
    2013-12-02 11:43:01,688 [localhost-startStop-1] WARN  ltInstalledExtensionRepository - Invalid extension [org.xwiki.enterprise:xwiki-enterprise-ui-mainwiki-5.2.1] on namespace [wiki:xwiki]
    2013-12-02 11:43:01,689 [localhost-startStop-1] WARN  ltInstalledExtensionRepository - Invalid extension [org.xwiki.enterprise:xwiki-enterprise-ui-wiki-all-5.2.1] on namespace [wiki:workspacetemplate]

    These are just warnings and don't affect that stability of your instance. Actually the Distribution Wizard you get (see the next section on "Upgrading wiki documents") will ask you to upgrade those invalid extensions and will remove the old versions that became invalid.

Get Connected