I made a backup (most of my config was done through the paper ui) as per http://docs.openhab.org/installation/linux.html#backup-and-restore and the resulting files were over 90MB compressed. lulz – that’s just embarrassing. I certainly hope there’s a better solution on the way. I strongly believe having the UIs store data in something human-editable would be a big improvement, for configuration purposes. These binary databases can’t be diffed, can’t be meaningfully stashed into version control, can’t be manipulated outside the UI… and it’s the recommended method for new users. Having the system r/w text files, or json files, or xml files, or… really just about anything else seems like it’d be a big improvement. I worry that OH2 is overengineered at every turn, like many enterprise java apps these days. Forcing a one-time upgrade and edit of OH1 text files into OH2 files (probably via some kind of tool, if needed) seems easy enough, but I’m sure this was debated already long before I started trying OH2. Oh well.
But seriously – 100MB of “configuration data” in a backup? It seems like the vast majority is in the ‘cache’ dir. Can that be omitted? What about ‘tmp’? Maybe update the backup script? Or will things go poorly if ‘cache’ isn’t restored properly, for example?
you are absolute right, these tiny thumb drives are not a very good reliable backup medium, but they are not worse than the sd card
So the usb stick has the advantage that i easily can exchange file between my 2 PIs running OH for testing.
As final Backup Medium i put the Backup files on my Synology NAS, but this is still yet all manual, so i need to find a way to save, lets say, always the last 2 backup files on the usb stick automatically to my syno nas. It is on my ToDo list
Are your Pis not on the same network as your NAS? If they are you can just NFS/CIFS or whatever mount a backup folder in your Synology NAS to the Pis and copy straight to that and bypass the thumb drive.
My biggest concern with the thumb drive is not how quickly it wears out or that you are using it as the final destination for the backups but the fact that you won’t necessarily know that it has failed unless you are somehow validating the files you copied off of the drive with the source files every time (in which case that means you can see your Pis from you NAS and have no need for the thumb drive in the first place).
You can happily be making backups for months only to discover one day when you need to restore that your thumb drive failed and all of your backups are corrupted or stuck back at a distant point in time, or more likely a combination of the two. It isn’t always obvious when these drives fail. Just look around at some of the strange behaviors people have seen when their SD cards fail. I myself discovered my SD card failed only because logrotate stopped working. It would delete the old files and rotate them only to have the old files reappear the next day. You don’t always get errors or flashing red lights. Sometimes it acts like everything is working just fine but that file you thought you wrote just disappears without a warning and without a trace.
tl;dr - even using the thumb drive to copy the backups from one machine to another is a bad idea
my PIs and NAS share the same Network. I just had not the passion yet to learn how to map my NAS drive :). I guess Linux will not become my best friend, so every new thing i have to look it up how to do it and sometimes things are different by the distros.
But the Forum here already helped a lot and your thoughts made change my mind and i will see how to map the drive manually and perform backups on the NAS then.
I think MOUNT will be the one command i need to look closer at, cause my nas is not running 24/7 and will be WOLed whenever i need it i have to map and unmap the share for backups.
Hi all, I wanted to direct people that were interested in a PR for openHAB that contains a backup and restore script for Linux and MacOS to be included in future versions of openHAB. It hasn’t been merged yet as it needs people to test it.
The scripts should work with the snapshot versions.
Hi @Austris_V, i have not yet needed the restore, but let me see what i can come up with during the day…
I already have some in preparation, but need to check if this should work.
I will follow up later on this.