How to image HaaS SD disk for backup/restore purposes?

Hope you can get me an idea of what and how to do the following properly:

I have PI4 with a high-speed 128GB SD disk installed in it. I spent days installing and then configuring, debugging the installation with all the add-ons, integrations, creating dashboards, etc. So far everything is working.

However I am not sure about the future - there might be an update with the OS/core or with the components which will break some part, or everything inside and I don’t want to repeat the whole exercise again.

How do I take a snapshot/image of the installation so I can restore it as is in case of bad things happened? Is dd the only option? I hope that there should be some other alternative.

In addition, a question regarding backup - what actually goes into the backup file? Just configuration settings? If so, and let’s imagine I am running 8.2 with 15 different integrations and add-ons, if I want to restore that backup on a new image, do I need to install the version I was running when backup was taken and all integrations/add-ons or just the core OS installation is sufficient?

Thanks

1 Like

I have a similar query and have similar concerns when I update HA.
However, I have HA installed on a NUC using the ‘Generic x86-64’ image installation method.
I would appreciate any advice or first hand experience anyone may have on the backup imaging of a HA installation for my configuration.

Thanks.

Just use the built in backup function (Settings->System->backups). It saves all your data, integrations, addons, etc… Make a backup, download backup, re-image, boot up new SD card, make dummy new account and login to homeassistant, upload backup and restore it. I’ve done it a ton, even moving from a PI to x86

I really like the hassio-google-drive-backup addon, which uploads an encrypted backup to google drive, so you always have it.

1 Like

I don’t bother with imaging etc. Just have google drive backup set to take a snapshot everyday. I have a test setup which i use to setup and play with stuff before committing to my production setup. My production system runs on a RPi4 and my test system runs on an old pc. I often use the back up from my production system backups to restore my test system just by restoring the snapshot. If I need to completely restore everything I just load a new Hassos and restore to that, far easier than trying to take an image.

1 Like

I’m looking into this as well. I’ve seen many comments that through the integrated backup routine you very often loose the database integrity hence all past data. scripts, integrations and configuration are essential to have I agree, but I really like longer term data as well.

If you in the HA terminal stop the core and then run a dd to another disc this should work right?