Hello all.
In the course of my work, I manage a Red Hat Enterprise Linux (RHEL) 9 server hosting an XWiki 16 instance. With a migration to XWiki 17 in mind, the plan is to switch to a new server, as RHEL 9 fails to provide some of the Xwiki 17 prerequisites (like Tomcat 10, for example). While a fresh installation of XWiki 17 on RHEL 10 works without any issues, migrating the existing data (and, ideally, the configuration) presents a challenge. I have explored two approaches (the first was successfully used for a previous migration from an older XWiki 11 version to XWiki 16) :
Strategy 1 : Once XWiki 17 is installed and configured (starting with an empty PostgreSQL database), we import a .xar file exported from the XWiki 16 instance. The problem is that, due to an architectural decision to store everything (including attachments) within the database, the resulting 2.2 GB .xar file is too large to be processed in a single operation. To address this, I created a custom Bash script that breaks down the original .xar file, removes any XWiki 16 components that should not overwrite XWiki 17 components and then repacks the data into smaller blocks of 200-250 MB. These files are then loaded and decompressed (a laborious process). Occasionally, it becomes impossible to import a new .xar block or delete one that was previously loaded. The only fix is to restart the Tomcat service. This is an extremely tedious procedure, as the troubleshooting steps must be repeated multiple times to successfully recover all our data.
NB : This strategy no longer seems to work : when we attempt to import the first block, the process just hangs, and the decompression never completes.
Strategy 2 : Between the initialization of the PostgreSQL database and the installation of Tomcat, we restore a PostgreSQL dump of the database taken from the XWiki 16 server. The subsequent installation of XWiki 17 runs into issues during the setup of the v17 “flavor,” hindered by the XWiki 16 configuration already present in the database. Ultimately, if we skip the installation of the v17 flavor, we retain all our data and configuration settings. Visually, everything appears to be working but the problem is that the resulting installation ends up being a messy hybrid of the legacy XWiki 16 and the new XWiki 17. Not clean.
With all that said, what is the best way to migrate our data from a legacy XWiki 16 server to a brand-new XWiki 17 server, as quickly, reliably and painlessly as possible ?