There I was, wanting to update my OH server in the cellar from the aging Pi 1 to a totally new Pi 3.
So I installed raspbian on a fresh SD card, copied my installation from the Pi 1 SD to the new one, played around a bit and then decided that I would go with hypriot ( http://blog.hypriot.com/ )
Easy, you say, right? Simply take the new SD card, write a new image on it since it was not really being used anyway, copy the OH installation from the old image, and be happy.
The bad thing is, somehow my old Pi noticed it was about to be replaced, got jealous of its successor, and spontaneously decided to corrupt its filesystem on the SD card. So, now I am left with a broken old installation which will not boot anymore, and a new installation on a new card which does not have any of my setup
Moral of the story: ALWAYS ALWAYS ALWAYS have backups of your system, especially if it is something as important as your house automation in which you have invested literally hundreds of hours…
Now, off I go, setting up a backup system for my fresh Pi. Quite possibly by using the simplest thing that works, just an rsync over ssh setup…
Really sorry to hear what happened to you!
Another or better an additional option is to track your configuration (talking about the textual configuration here) with git and sync it to Github or whatever you prefer. Has many benefits to it, acting as a kind-of backup is one of them.
“Second rule of backups: Check whether they are restorable.”
Totally agree. And check this on a regular base!!! In general you have a system which changes and this can break your backup process (files or directories changed names, mount points changed …).
Well backups are good…
but svn commit after each change in config is better. Just make a rule for yourself: changed something - commit it. This creates more discipline.
I heard this once: The best backup is the backup you do.
It doesn’t really matter if you utilize git or svn or whatever versioning system is out there. The important thing is to have one set up (incl. server) and actively used. I guess @Artyom_Syomushkin owns an svn server, so why not use it
For everyone else it’s probably a good practice to use git and a GitHub account to track their configuration. I would even recommend to do this in parallel to etckeeper and a full SD backup as mentioned above.
After a year of openhab use, I’m now:
-processing automatically a full backup of the sdcard every week to a USB key with three previous backup retention
-storing the configuration folder on bitbucket (they enable to have private repository which are usefull when you have your alarm parameters on your config), with bitbucket I’m also tracking my changes and issues of my installation (openhab configuration, scripts, parameters, crontab…)
Forgot to mention. Off-course I also make full backup images of SD card and Z-wave USB Stick. Usually after I add some devices. But this is done from time to time.