Backup your RPI!

i know that lost of hass users run it on RPI like me.
I just needed my backup for the second time in 2 months!

so for those who didnt do it untill now:

make sure you have a backup sd card from your RPI as soon as you have hass running like you want it to run.

this will save you the trouble off reinstalling everything again and for the second time figuring out what you need to do.

did you add new components? or did you update hass, appdaemon, hadashboard?
save a new image!

as i read on more places then i like:

your raspberry PI will fail at some moment!

3 Likes

Same for me, twice in two months.

Last time my SD backup was a month old, but my config files were only a day old. Even that was sort of painful.

same here, sdcard a month old, configfiles from last night.
i needed to reinstall tts, vlc, mpg321 and overwrite the whole pi dir that i backup.

took me about a half hour. which could be 10 mins.
but i am glad i had that! or it would have cost me half a day.

if you only have a few lighting automations running thats not a real big problem, but my heating depends on hass as well.

i know there are lots off people that havent made a backup yet. or dont know how.
thats why i wanted to remind people.
and if they dont know how, they can ask here. :wink:

On a side-note, if there are people who are worried about SD corruption on the Pi - there are the Odroids.

With the odroids you can use eMMC cards instead which are practically immune to the type of corruption that can happen to the Pi, they are considerably faster too. The Odroids also take SD cards, and treat them much kinder than the Pi do.

The Odroid C2 is the Pi equivalent, and runs Hass very well. It’s nearly the same price as the Pi though an eMMC card will cost ~€30 as opposed to an SD card’s typical €10.

A small expense that I think is worth it for less worry, even when backups are regular.

The Odroids also don’t share ethernet / USB circuitry as the Pi does - so you should notice some improvements due to that.

The C2 has an infrared receiver, and hardware HEVC playback. So it’s ideal for a living room Hass / Kodi combo. The drawback to the C2 - they have no built-in Wifi or Bluetooth.

There’s also the XU4 if you’re looking for a beefier ARM device.

The XU3 & U3 are great but don’t get updated kernels anymore.

Stores:

Korea (manufacturer):

http://www.hardkernel.com/main/main.php

Germany:

US:

http://ameridroid.com/t/single-board-computers

for now i dont want to spend another 100 euro or more and throw what i have away :wink:
but it is something to consider when someone hassnt got his equipment bought.

1 Like

I used 100+ pi running 24/7 for >1 yr with about 2-3% failure(various cause) with another application.

I did have issue with corruption when running HA that seemed related to huge log building up. upon reaching 10GB or so SD become unrecoverable. Happen twice. I moved DB log to seperate server and issue hasn’t returned.

I recommend backup but reliability is more important vs recoverability to me. Moving log to seperate device (another pi or NAS) may be solution to reliability.

I wondered if using Dropbox to pick up and auto upload any config changes might be an option here?

i havent got a big db anymore because i have a purge of 1 day.
still it happens.

but it could be that i turn off the recorder at all.

it isnt the problem from some config files that arnt what they should be.
the sd card gets corrupted and the rpi doesnt start up anymore.

at that moment you can have things on dropbox, but you wouldnt be able to reach that before you completely reinstall everything.

There’s another alternative to backing-up regularly: Syncthing - https://docs.syncthing.net/

  • Install Syncthing on your Hass device

  • Specify your configuration file folders for syncing,

  • Put Syncthing on another computer, or even a phone and tablet, create a folder with the same name on that device then sync it and it will automatically copy the changes made on the Hass device’s config files.

This can be done as a pure back-up: changes to your Hass config are simply sync’d over (Master > Slave)

Or it can be done both ways, so changes you make on that other computer / phone are also made to your Hass configs.

As you’ve probably guessed, I am a big fan of this program. It has simplified my life greatly.

More details:

1 Like

nice, but if your sd card gets corrupted, you will still spend hours reinstalling if you dont have a backup sd card!

True, and I’d never be without a backup.

Though when corruption happens on the SD it will kill the Syncthing process, and the error correction within Syncthing itself will stop the corruption spreading to your sync’d files.

And you’ll have the very latest copy of the config files to put back into a backup.

Plus, it’s very handy to change your Hass config from anywhere in the world.

Looks like it might be possible to do a “live” backup to a USB attached SD card, see the second post here:

https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=62929

1 Like

i make a “live” backup from the image to a networkdrive. works about the same.
if that is done i make an sdcard from the image that is on my PC hardrive.

I havent automated it yet but i plan om making a imagebackup regularly so i can always go back a few days.

i want to implement a control function so that if an image gets activated that it first checks on my network if there are newer config files, if so first copy them all then start hass.

if i got that allright, i only need to insert a backup image and it will automaticly brought up to date.

I don’t know if anyone else uses it, but I regularly make backups using rpi-clone. It will make a clone of your current boot drive to a spare micro SD card in a usb card reader and can handle incremental updates.

5 Likes

I remember seeing something a couple of weeks back about someone that was backing up their config files to git. I know that doesn’t solve the sd card issue of having to re-install everything, but this thread made me think about it. Does anyone have a solution like that? I would be interested in storing my files there but have no idea how to go about it.

I keep my config stored on git, and have both a master and dev branch. Using git, I can make all of my changes online or using the git desktop app and then run git pull on my pi to sync everything.

1 Like

Actually what I’m looking for are scripts that would be run by an HA automation that update the files on git.

Would love to see something like this as a component. Turn my office light red when there is a failed backup. :slight_smile:

It wouldn’t be hard to do with an automation. It could simply run a command line script that would git push.