From the command line use sudo openhab-cli backup --full this will make a backup zip file and tell you the location it’s stored (var/lib/openhab2/backups). Move this file to your PC or USB stick.
To restore the backup:
Place the backup zip file into the backups folder then,
sudo systemctl stop openhab2
sudo openhab-cli restore var/lib/openhab2/backups
sudo systemctl start openhab2
To update/upgrade you can use the openhabian-config tool if you installed openhabian.
From the doc’s:
If you are working with an openHABian setup, the upgrade is quite easy. Regardless of if you are currently using the openHAB 2.5 stable release or one of the latest 2.5 SNAPSHOT builds, switching to openHAB 2.5.0 stable is done in just a few steps:
- Connect to the SSH command line and execute:
sudo openhabian-config
- Select the “Update” option
- Wait for the openHABian update to finish, reenter the openHABian configuration tool
- Select the “openHAB 2.5.0 stable” option
If no openhabian then you can upgrade or downgrade per the doc’s using:
Apt Based Systems
Upgrading is as easy as:
sudo apt-get update
sudo apt-get upgrade
You may want to switch to a different repo, or an older (but more stable) version of openHAB. To do this, simply select the repo as in the installation instructions above, then find the version by bringing a list of all versions available to install:
sudo apt-get update
apt-cache showpkg openhab2
Once you know which version you want, you can upgrade/downgrade to it by using the apt-get install openhab2=[version]
command, for example:
sudo apt-get install openhab2=2.1.0-1
When you run the showpkg command, like above, you should have a full list to choose from. Pick the one you want and enter it like described in the last command.