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

Automatically backup the configuration when upgrading via a package manager #230

Open
nelsonaponte opened this issue Aug 30, 2024 · 2 comments

Comments

@nelsonaponte
Copy link

nelsonaponte commented Aug 30, 2024

When openHAB is managed by a package manager (apt, yum, dnf) and the user attempts to upgrade it via the package manager, the first step of the upgrade process should be to make a full backup of the current configuration (as done by the command openhab-cli backup) and store it under the standard backups folded (/var/lib/openhab/backups/) using the filename specified in #228.

After the upgrade is completed (successfully or unsuccessfully), a warning message with the message "Please note that a full backup of the old configuration was taken and stored in /var/lib/openhab/backups/ at the beginning of the upgrade process." should be displayed.

Reason

Many users don't know how to backup files or forget to do it before upgrading to a newer OH version. The upgrade process could take care of that for them.

@BClark09
Copy link
Member

BClark09 commented Sep 2, 2024

Hi @nelsonaponte, thanks for your issue posts regarding backups!

A full backup (--full) includes a lot of files that would usually be considered unnecessary, this is a good idea for relatively simple setups but might make the installation too large over time for more complex setups. The other side of the scale here is that users might not realize a backup is being made (users might miss such a warning when upgrading using a manager like apt when they upgrade many packages at the same time).

@nelsonaponte
Copy link
Author

Hi, @BClark09. Thanks for your response.

Even if users miss the warning, the backup will be there and might save them in the future. At least they will be warned when trying to uninstall OH that the backups were not deleted. We should also communicate it in the documentation.

About the full backup, do you know if there is any option that would suffice? I guess the textual and UI configurations should be backed up, but I don't know what else. I backup using the command openhab-cli backup.

Alternatively, the user could be asked with a prompt when the upgrade process begins if he wants the system to take a full backup or not. I don't know if there are users with any kind of automatic upgrade configuration and this would make it a bit annoying for them, but for most, it should be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants