Skip to content

Commit

Permalink
Add Linux/MacOSX backup and restore instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Clark <ben@benjyc.uk>
  • Loading branch information
BClark09 committed Aug 5, 2017
1 parent 2d06ae7 commit a7bbf7d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
32 changes: 30 additions & 2 deletions installation/linux.md
Expand Up @@ -346,6 +346,33 @@ 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
cd $OPENHAB_HOME

sudo ./runtime/bin/backup
## OR ##
sudo ./runtime/bin/backup /path/to/backups/folder/myBackup.zip
```

To restore from these generated files:

```shell
cd $OPENHAB_HOME

sudo ./runtime/bin/restore $OPENHAB_BACKUPS/myBackup.zip
```

If you're unsure how to use the above files, just use `--help` or `-h`:

```shell
./runtime/bin/backup --help
```

Otherwise, you may do this manually by:

```shell
# stop openhab instance (here: systemd service)
Expand All @@ -365,8 +392,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 +647,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
29 changes: 29 additions & 0 deletions installation/macosx.md
Expand Up @@ -133,3 +133,32 @@ 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
cd $OPENHAB_HOME

sudo ./runtime/bin/backup
## OR ##
sudo ./runtime/bin/backup /path/to/backups/folder/myBackup.zip
```

To restore from these generated files:

```shell
cd $OPENHAB_HOME

sudo ./runtime/bin/restore $OPENHAB_BACKUPS/myBackup.zip
```

If you're unsure how to use the above files, just use `--help` or `-h`:

```shell
./runtime/bin/backup --help
```

0 comments on commit a7bbf7d

Please sign in to comment.