I’m running HAOS on a Raspberry Pi using the SD card. I have nightly backups that I would like to test from time to time, with a minimum impact on the production. My idea was to create an new SD card using the imager, then somehow restore my backup on the card, but directly using my personal laptop, and without stopping the production Raspberry.
I can’t find a way to restore the backup to the SD card without actually using the SD card to boot on the raspberry. Any idea?
Thanks for the replies. I will go with a second RPI or cloning of the production SD. I really hoped there would be a way to apply the backup to a new card, after all it’s just about copying files from one place to another.
I have a similar situation. I don’t see how a 2nd RPi would help though. Beyond the cost, the production image restored to the test hardware would not be a good test. All the edge devices would be connected to the production machine, and the test machine would be looking for all those same devices.
My production HA machine is off-line for regular version updates anyway. I try to do that during times when there’s not a lot of activity in the house. I’m thinking maybe I’ll just make the outage window a bit longer, and do some restore testing during that time. Since I make a backup just prior to updating, I could even leave the restored system as the new production environment.
The second RPI would be used to create a new SD card and restore the backup on it without disturbing the production. But then you’d still need to test the results in the production (shutdown -swap cards - restart). This is minimum impact, I don’t see how you can do less.
My hope was that instead of a second Raspberry I could use my laptop to do this (Mac or Linux with ext4 support).
Laptops are mostly x86, not arm (except recent Macs). So the card would not even boot. And Pi’s need a special bootloader, which even an ARM-based Mac does not have.
For the backup .tar to be restored, HA needs to be running. You can extract the contents of the .tar and copy them manually to the SD card, but to test if it is working you still need to boot from the SD card.
I did think of that but the structure of the filesystem looks very different between a new SD card created using the imager, and the contents of the backup tar. No idea where each part should be copied.