Skip to content

Commit

Permalink
Add Linux/MacOSX backup and restore instructions (#468)
Browse files Browse the repository at this point in the history
* Add Linux/MacOSX backup and restore instructions

Signed-off-by: Ben Clark <ben@benjyc.uk>

* Change to absolute path references

Signed-off-by: Ben Clark <ben@benjyc.uk>
  • Loading branch information
BClark09 authored and ThomDietrich committed Sep 25, 2017
1 parent 51a6953 commit ff4d9c7
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
28 changes: 26 additions & 2 deletions installation/linux.md
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions installation/macosx.md
Expand Up @@ -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
```

0 comments on commit ff4d9c7

Please sign in to comment.