I would not see this as a workaround. The CLI command is the standardised way to create a backup, how to call this command ( console or UI, in case of UI which? MainUI widget, sitemapp, HABPanel?) and where to externally store the backup is dependant on your system and personell preferences.
openhab-cli is the recommended interface to do backup/restore so no that is not a workaround.
It is no OH user functionality and that’s why there are no plans to put it into the GUI I know of.
If you use openHABian, it’s accessible via its text UI.
Do we not also put administrative tasks in the GUI as well as user functionality? PaperUI / Main UI has a large area dedicated to admin so it could be added if there was a desire, and I would agree that making this easier for people makes sense doesn’t it?
Of course if this was implemented, such things would need to be looked at, but the issues you mention are relatively easy to work around and other systems out there do this from a web based UI. For example, many websites are managed through control panels - these provide functions to backup and restore everything on a site.
If the system was down, then of course the first step is always to get a basic system installed, and then recover the system from there.
As with anything - it needs to be designed - not just implemented.
I don’t have much to add except to say it’s not there because no one has done it. Unlike a lot of things brought up like this, I don’t think it would be all that hard to implement. It’d be a lot of work but not hard work I think, except for maybe the restore because OH probably really needs to be offline in order to restore to the JSONDB files or else what ever is in memory might be written over the restored files. A nice little pair of API calls to OH to stop writing to and then reload the JSONDB could be one way around that.
However, it is very clear to me that many users have a hard time figuring out the boundaries of what is openHAB and what is not openHAB. There will be users surprised by the fact and angry when this backup and restore feature doesn’t restore their Mosquitto configs, InfluxDB and Grafana, and anything else they may have installed through openHABian.
OK - I have it working as follows. SiteMap GUI: The ON/OFF button does not go ‘ON’ when the command is running … but the OFF -> ON -> OFF events are in the events.log?? Classic UI: refuses to exec when clicking the ON/OFF button??
This is good enough for my needs. Simple backups.
If a restore is needed, happy to go CLI as that (should be) a rare event.
Can you please provide your code as a PR to openhab-distro. It’s not universally applicable but can be (become) a first step. Mind CONTRIBUTING.md
Use three backticks before and after code to properly display it here.
For me the only reliable way I have found to backup is to shutdown, copy the SD card to an image file and then create new/recycled SD card and fire up again on the new SD card. Then I know the old SD card is a quick recovery option, if I break something or an upgrade goes wrong, I just put the old SD card back in move on, WAF is maintained. I keep copies of the image files on my NAS and cycle 4 SD cards through. I know this process may be a bit cumbersome but it has worked for me for a few years.
(I do need to have another go at the openhabian automated backup approach, I failed to get this one working)
I think it would be great to be able to do a backup of OH in the main UI and be able to download the file for a restore in the same place, say in a clean openhabian install. I work a bit on Moodle and they have a similar process that works really well for peace of mind, changing hardware, hosting ect.
I appreciate it needs to be created. I think it would add a lot of value to the project for automation enthusiasts who may struggle with linux.
I think you have a fundamental misunderstanding what this is about just like @rlkoshak suspected would happen with some users.
There is the openHAB config. That you can backup/restore using openhab-cli or by selecting menu 51 in openhabian-config today. This thread is about making that accessible from the web GUI, no more, no less. It will not change what is backed up/restored.
If you want to backup anything beyond your pure OH config like e.g. a mosquitto config (mosquitto is not a part of OH) or any config of whatever external tool such as those you can install through openHABian then this thread will not help you.
This is right what Rich suspected would happen (see his post).
To backup your complete system (== SD card) including OH, its config, mosquitto and its config and everything else you might have installed, you can use the openHABian backup/restore tool Amanda today. No need to pull out your SD card.
Note this is not the same as the openHABian auto-backup feature.
With all due respect I don’t think I have a misunderstanding. I understand the boundaries of OH config, add ons ect. I didn’t mention anything about mosquito or the like.
In my short experience with OH3 I have seen the large strides made, really appreciate the work by all developers. I transitioned from 2.x without much textual configuration and have really enjoyed using the new main UI, simply copied/pasted my rules in the GUI and all worked fine.
It appears to me that the main UI will suffice for many users, for many more tasks than before and may combine sitemaps/paper UI and remove the need for textual configuration for many more tasks, this will be great for OH in general.
My point and suggestion is that I think Rob has a great idea to add backup/download & restore via the main UI. Apologies if that upset you.
For what it’s worth, I also read your comment and thought you might have the confusion that Markus and Rich are concerned about. I think that’s because you first mentioned your process of cloning SD cards, so if you weren’t familiar with the openhab-cli backup process you might have thought it could replace this effort. Obviously that’s not the case, but it’s worth clarifying to be sure.
I also clone my SD card regularly, largely because I also run Network UPS Tools and Mosquitto on my RPi. I might play around with the new auto-backup feature if I find the time.