The RPi4 needs an internet connection to access an NTP server to set the time on the RPi4 because the Pi does not have a battery backed up clock onboard. I have seen other discussions on this forum for getting around this but I have not tried them - I am ok having an internet connection (I manage my internet traffic using firewall rules). Home Assistant also needs an internet connection to check HA component updates but you decide if / when to apply these updates.
My procedure:
-
Shutdown Home Assistant: Settings → System then click the “power” button in the upper right corner
-
Power off the RPi4 before removing the SD card.
-
Remove SD card and mount on a Windows 10 PC (I have not upgraded to 11 yet).
-
Shutdown / exit Google Drive (this is an important step for me because the next step will not work if I do not do this).
-
Run Win32DiskImager to Read the contents from the SD card to a windows image. Note: you need enough free disk space to handle the entire size of the SD card regardless of how much space is actually used on the SD card).
-
Get another identically sized SD card and format it using SD Card Formatter.
-
Run Win32DiskImager to Write the windows image file back to the SD card.
-
Use the Windows Eject (safely remove) the SD card from Windows.
-
Place the new SD card into the RPi and reapply the power.
I have been using this procedure every month for over 4 years. It has never failed. It proves that the backup AND restore actually work. Since the old SD card is a working system, you know you can drop back to it if needed (which I have done a few times for various reasons).
I have a set of 4 SD cards that I rotate through: Current (production), backup 1, backup 2, backup 3. I have never had an SD card failure…yet. But if I do, I’m ready. The down side of this approach is that I could lose up to a months worth of historical data. That does not matter to me but it might to others.
I also use the Google Drive add-on solution. This runs on a weekly schedule but I have never needed to restore using these backups (I really should test this ).
You may also want to look at: Disaster Recovery Planning. It is part of the Home Assistant Cookbook Index that has some other good info too.