These are conservative Arch Linux openHAB 3 to 4 upgrade instructions which allow an unrushed upgrade procedure and testing on a separate machine.
On the production openHAB server, firstly upgrade to latest openhab3
package. Then make a backup using openHAB's official tool:
export OPENHAB_USERDATA=/var/lib/openhab3
export OPENHAB_CONF=/etc/openhab3
/usr/share/openhab3/runtime/bin/backup openhab3-backup.zip