Thing to remember: always back up your installation :(

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 :cry:

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… :blush:

or use https://www.linux-tips-and-tricks.de/en/backup :grinning:

1 Like

Nice, thank you for the hint.

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.

Yes, actually I kept lots of my configuration in git via etckeeper, but somehow never noticed that the daily cron job broke :blush:

First rule of backups: Check whether you are actually running what you think you are running. :smile:

Second rule of backups: Check whether they are restorable.

“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’ve seen people suggesting to use git to save their system which is similar to svn. But that’s a sledgehammer to crack a nut :slight_smile:

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 :wink:

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.

I use the sd card only for ‘boot’

All other is on a USB Stick… However I have a raid1 for 2 USB sticks on my ToDo list forever…

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…)

3 Likes

Hi, how do you do that?

Thanks,

Luciano

You mean processing the backup ?

Hello @ilpipe, please state your question clearly.

and so on.

Sorry for my short question. I´ll search it before I make another question.

Thanks,

Luciano

I make changes on githib and then sync to server. that way I’m sure I keep latest version of configs…

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.