Intro
1.1. I have Pi4 it was runing debian 11 updated november 2023.
1.2. It was running OH 4.0.1, and i decided to do openhab upgrade for better performance as 4.0.1
was a bit slow to start and it used more cpu than i like 50 to 60%.
1.3. I ran apt update && upgrade
and it failed with error 127. Here is the apt log.
term.log (4.4 KB)
I think i have a backup, Nuked the openhab
2.1. I have a full system backup from november 2023 and i have all configs copied, but i forgot to copy
userdata folders like bindings and databases so i dont have latest from today.
2.2. Ehhh and i did a stupid move i pissed it off with apt purge openhab as it wouldn’t install any
version of openhab anymore, wierd error right?.
2.3. As i was doing a remote maintenance i was unable to load new USB drive from backup and pop it in Pi4. So i had to fix by reinstalling.
2.4. Why did this install borke and how can i prevent it next time?
Fresh install
3.1. I did fresh openhab install of 4.1.0 this time as i didn’t quite like the 4.1.2 behaving on me and the 4.1.0 installed fine.
I had to do fresh setup install 6 bindings and i called over the config to the new setup and i is now back alive.
3.2. Than i needed to do initialization of my settings for devices as i lost database, so it took me 2 hours to fix my mistake of upgrading without latest userdata backup.
openhab built in backup
4.0. So if i knew right, i should run openhab backup command befor upgrade, does it back up all necessary userdata databases and bindings as well? So i could restore in seconds right? As copy of full usedata folder is quite big and backup of userdata is small, thats why i ask?
4.1. I noticed in linux that all latest aplications tend to install perfectlly one day but fail in denvers the next as they evolve daily. I faced the issues countless times that i couldn’t make the system work back if i didnt have a backup as it messed up sectacularly, thankfully openhab didn’t leave any issues behind after a purge.
Prompt for backup befrore upgrade
4.2. Could a openhab enforce or do automatic backup of config and userdata to home directory or somewhere external to folders that get purged so users don’t nuke the latest settings that may not be backed up yet
4.3. An automated backup job that runs before every upgrade and on daily/weekly basis could be usefull right? with embeded command like this
sudo $OPENHAB_RUNTIME/bin/backup home/pi/Documents/openhab_userdata_$(date +'%d.%m.%y_%H:%M:%S').zip
4.4 So if i am right i can call restore like bellow to copy back the zipped files.
sudo $OPENHAB_RUNTIME/bin/restore /home/pi/Documents/openhab_userdata_9.5.24_21:13:12.zip
Autimatic backup
5.1. One may write a script to be ran by systemd or openhab, but i dont know how to triger it before upgrading openhab to make sure thinhgs are backed up.
5.2. Maybe this is also the idea that OH devs can implement in new version as a prompt to do a backup?
5.3. I guess OH users will appriciate even if there were a prompt to do a backup with a comand to copy as there is not obvious in docs what command to call for backup it is all about the Amanda that is a bit too complicated and burried down is this simple comand.
Like UniFi does automatic backups, OH can too.
I am sharing my experience
Backup solution ideas appreciated, especially built in OH
Cheers
Matej