I know, it’s a tale as old as time - I’m running HA on an SD card that failed. After numerous attempts, I was finally able to make an image of the card (understanding that the source data is likely corrupt). Digging around in other articles and forum posts, it looks like there should be a /backup folder but it doesn’t appear in any of the 8 partitions. I found another user who had success creating an image of their faulty card then burning it to a known-good card but this didn’t work for me (solid green light on the Pi and no network presence after ~10 minutes).
So, I’m wondering a couple things:
Where, in the file system are the automatic backups that are created when an add-on is updated?
Could I, instead, burn a fresh image of HA to my new SD card and copy the files from one of these partitions to recover my installation?
Well, I was able to get backups from the supervisor/backup folder but, unfortunately, they’re all partial backups and they brick HA. So now I think I’m looking at copying over the folder contents of my old image… What do you guys think about just copying the contents of the supervisor folder to a fresh HA instance?
not a good idea , but you can always try
but as i mentioned you have your /config ( / homeassistant ) inside /supervisor … that all you have to tamper with
Installing a new fresh HA ( with Supervisor ), and pasting a folder from an old (supervisor=system folder) is … well i dont have words for this , kind of like installing a new Windows, and replace the /Windows folder with the one from your old crashed windows … if it make you comfortable, And have anything in your /backup /share /media etc. folders then copy this ( if it’s worth it )
Ah, that makes sense and I appreciate your analogy!
So it really should just be as easy as copying over the old /homeassistant folder and its contents? What about all of the JSON config files for the various add-ons? Should I install the add-ons I was using previously before copying over the /homeassistant folder?
IF you are going to tamper with anything in your .storage folder , i suggest you don’t
But files like yaml and config-files like json is plain text , so yes these can be replaced
Dashboards , in storage-folder can also , or you can use an online tool to convert these json-files to yaml , and paste the code in New created Dashboards.
Yes i would install add-ons again , even integrations , cards , even most of these should be possible to copy paste , if you remember to manually add them as Resources.
But i would reinstall these also, and just copy-paste the files-folders in custom-components / community , If it’s same versions as previous.
Dashboards , from old .storage , as mention can be converted from json to yaml -with all the cards-configurations , safer than tampering in .storage on a running instance , depending upon which HA you are running , but if you Stop Core , you can still access .storage , if you want to try replacing files there
SO , latest is No Recommendations or Solution , It’s a trail and error approach , which you should have in mind
It’s not the best but if they don’t have valid backups then if they copy the entire config folder including hidden sub-folders it is perfectly fine. It is not like your windows metaphor at all.
They will only have to re-install any add-ons they use. They may even have partial backups they can use for this after the config folder copy.
He was talking about copy and replace /supervisor ! … that is a whole other ballgame … and i said twice atlest … go for /config /homeassistant …thou not play with .storage while running
Yeah, I was considering copying over the /supervisor folder hoping it had everything needed to just pick up where I left off. Unfortunately, that broke the HA instance.
Additionally, I used this post to try and copy the contents of the backup as well as the recovered image from the dead SD card. Again, that got me nothing but a broken HA instance.
So now my plan is this:
Get a basic HA instance with one of my main addons installed (I think I’ll start with Z-Wave)
Attempt to copy over JUST the Z-Wave things from either the back up or the recovered image
If that works, move on to Zigbee and Zigbee2MQTT and the rest
I guess what I don’t understand are the prerequisites to getting recovered files from the addons to start working as they were.
Okay, I think I’m 99% recovered; just waiting to see if all of my automations behave themselves. I was able to have the most success by firing up a fresh install of HA, installing the Z-Wave and Zigbee addons I had before; then I installed the SSH addon and used it to stop and start the HA core; once the core was stopped, I would transfer over files from the .storage folder of my backup. Of course, I would backup the working version prior to transfer, then start up the core and see if it recovered. Slowly but surely, things started to come back, although I had to manually setup my Zigbee network again.
Right now, the only thing I can’t get working are the conditional State Badge colorings for the various doors in my house. I installed HACS and the card-mod addon; tested that it’s working, but can’t figure out how to get things working again. I see that @boheme61 has a lot of activity on the threads I used to set this up originally. Any chance you’d be willing to take a look at what I might have done wrong?
Yeah , im struggling with card-mod, on weekly basis
However , i think it’s best you mark your last ( Story ) as Solution for this Topic
Other might find this topic useful , so it’s a pity to cluttered with card-mod issues.
Post in the Official Card-Mod Topic, paste your card-code , and if everything else in the Dasboards, works and looks the same, that part should be ok., if i dont pop in there, just ( Knock )
Well, what do you know! Unfortunately, I was using the right syntax but it got me looking closely at the code… Turns out there was a hyphen where an underscore should have been. Swap the characters and all is groovy. Thank you for the suggestion!