diff --git a/installation/linux.md b/installation/linux.md index a656a925af..8e362097e8 100644 --- a/installation/linux.md +++ b/installation/linux.md @@ -346,6 +346,29 @@ sudo yum install openhab2-2.1.0-1 #### Backup and Restore To make a backup of your openHAB 2 system, you need to retain your configuration and userdata files. +As of version 2.2.0, you can use openHAB's scripts for storing your configuration in a zip file. +By default, the script saves the zip file in `/var/lib/openhab2/backups` for automatic installs and `openhab2/backups` for manual installs. +You can change the default path by setting the $OPENHAB_BACKUPS environment variable. + +```shell +sudo $OPENHAB_RUNTIME/bin/backup +## OR ## +sudo $OPENHAB_RUNTIME/bin/backup /path/to/backups/folder/myBackup.zip +``` + +To restore from these generated files: + +```shell +sudo $OPENHAB_RUNTIME/bin/restore $OPENHAB_BACKUPS/myBackup.zip +``` + +If you're unsure how to use the above files, just use `--help` or `-h`: + +```shell +$OPENHAB_RUNTIME/bin/backup --help +``` + +Otherwise, you may do this manually by: ```shell # stop openhab instance (here: systemd service) @@ -365,8 +388,8 @@ rm -rf "$BACKUPDIR/userdata/tmp" sudo systemctl start openhab2.service ``` -If you later want to restore settings, just replace them. -Maybe you will need to delete the existing data first. +If you later want to restore these manual settings, just replace them. +You may want to delete the existing data first. ```shell # stop openhab instance (here: systemd service) @@ -620,6 +643,7 @@ sudo rm /lib/systemd/system/openhab2.service | Site configuration | `/etc/openhab2` | `/opt/openhab2/conf` | | Log files | `/var/log/openhab2` | `/opt/openhab2/userdata/logs` | | Userdata like rrd4j databases | `/var/lib/openhab2` | `/opt/openhab2/userdata` | +| Backups folder | `/var/lib/openhab2/backups` | `/opt/openhab2/backups` | | Service configuration | `/etc/default/openhab2` | (not preconfigured) | ## Viewing Log Messages diff --git a/installation/macosx.md b/installation/macosx.md index c1c1a71b0c..8202e13152 100644 --- a/installation/macosx.md +++ b/installation/macosx.md @@ -133,3 +133,30 @@ Assuming the openHAB directory is in `~/openhab` simply run the following comman cd ~/openhab sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/openhab/openhab-distro/master/distributions/openhab/src/main/resources/bin/update)" -- 2.1.0 ``` + +## Backup and Restore + +To make a backup of your openHAB 2 system, you need to retain your configuration and userdata files. +As of version 2.2.0, you can use openHAB's scripts for storing your configuration in a zip file. From the terminal: +By default, the script saves the zip file in `/var/lib/openhab2/backups` for automatic installs and `openhab2/backups` for manual installs. +You can change the default path by setting the $OPENHAB_BACKUPS environment variable. + +```shell +sudo $OPENHAB_RUNTIME/bin/backup +## OR ## +sudo $OPENHAB_RUNTIME/bin/backup /path/to/backups/folder/myBackup.zip +``` + +To restore from these generated files: + +```shell +cd $OPENHAB_HOME + +sudo $OPENHAB_RUNTIME/bin/restore $OPENHAB_BACKUPS/myBackup.zip +``` + +If you're unsure how to use the above files, just use `--help` or `-h`: + +```shell +$OPENHAB_RUNTIME/bin/backup --help +```