Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linux/MacOSX backup and restore instructions #468

Merged
merged 2 commits into from Sep 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
```