Unix Merge Configuration Files
Last modified by superadmin on 2026/11/25 21:35
Keep your settings and the options the new version added, by moving the new files aside and combining both versions with sdiff.
Explanation
The commands below use standard Unix tools when upgrading an XWiki distribution using the ZIP package on a Unix system, assuming xwiki.new is the directory of the new installation and xwiki the directory of the previous one.
Back Up the New Files
Each configuration file of the new installation — web.xml, xwiki.cfg, xwiki.properties, struts-config.xml and logback.xml — is first moved aside under an .ori extension, so that the merge can write the result back under the original name:
mv xwiki.new/WEB-INF/web.xml xwiki.new/WEB-INF/web.xml.ori
mv xwiki.new/WEB-INF/xwiki.cfg xwiki.new/WEB-INF/xwiki.cfg.ori
mv xwiki.new/WEB-INF/xwiki.properties xwiki.new/WEB-INF/xwiki.properties.ori
mv xwiki.new/WEB-INF/struts-config.xml xwiki.new/WEB-INF/struts-config.xml.ori
mv xwiki.new/WEB-INF/classes/logback.xml xwiki.new/WEB-INF/classes/logback.xml.oriMerge with sdiff
sdiff then compares the file from the old installation with the backup of the new one and writes the merged result into the new installation:
sudo sdiff xwiki/WEB-INF/web.xml xwiki.new/WEB-INF/web.xml.ori -B -W -E -o xwiki.new/WEB-INF/web.xml
sudo sdiff xwiki/WEB-INF/xwiki.cfg xwiki.new/WEB-INF/xwiki.cfg.ori -B -W -E -o xwiki.new/WEB-INF/xwiki.cfg
sudo sdiff xwiki/WEB-INF/xwiki.properties xwiki.new/WEB-INF/xwiki.properties.ori -B -W -E -o xwiki.new/WEB-INF/xwiki.properties
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
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.xml