1. Introduction
I needed to restore Home Assistant after a failure caused by myself when playing around to solve an add-in issue. Home Assistant was rebooted and everytime it was alive it rebooted again in a few seconds. I tried several ways to fix the issue without success. The only option to get Home Assistant operational again was a fresh installation and restoring a Home Assistant backup.
Our Home Assistant is installed on a NVME SSD in a Raspberry Pi 5 on which I am using the ONEdrive addon to store local backups on ONEdrive on a daily base.
2. Install Home Assistant OS
Before we can restore Home Assistant from a backup we need to install a fresh copy of the Home Assistant Operating System on the NVME SSD.
- Remove NVME SSD from the Raspberry Pi 5 casing and install it in an external SSD access casing with USB connection to a Windows computer.
- Go to https://www.raspberrypi.com/software/ and download the “Raspberry Pi Imager” for Windows. Install the software.
- Run the “Raspberry Pi Imager”
- Select the correct image and the connected NVME SSD device:
a. Select Raspberry Pi 5 as the Raspberry Pi device
b. Select as operating system
c. Click on the next button.
- Click Yes to confirm overwriting the SSD
The Home Assistant OS image will now be written to the SSD and then verified.
- When a similar message as below is shown, safely disconnect the SSD from Windows.
The Raspberry Pi imager software can now be closed. - Put the NVME SSD back in the Raspberry Pi 5
See for more details: Home Assistant installation on a Raspberry Pi
3. Start up your Raspberry Pi
- Plug in the Ethernet cable.
- Connect the power supply to start up the device
4. Restore the Home Assistant backup
The next step is to restore your Home Assistant instance from a backup created before your issue occured. My backups are automatically stored on OneDrive. To speed up things I copied the backup file to a local drive on my Windows computer. My backup file, when writing this article, was around 14Gb and it took a few minutes to download it from OneDrive on a 250mbit internet connection.
- A few minutes after the Raspberry Pi was started the Home Assistance instance can be reached via http://homeassistant.local:8123
- The screen shown in your browser will look like the one below. Click on the “RESTORE FROM BACKUP” link.
- Click on “UPLOAD BACKUP” to upload the backup file from your computer to the freshly installed Home Assistant instance.
- Restoring the backup will start
There is no indication what is happening and how long this upload step will take. Just be patient :-). In my situation with a 14Gb backup file it took 6 minutes to display the next screen:
Click RESTORE to restore the full backup. A warning will be displayed; click again on RESTORE.
- The restore process will start. There is no progress indicator neither an estimated duration. Be patient. In my situation restoring the 14Gb backup file took 15 minutes, so not that bad.
I did not refresh the screen and after the 15 minutes the login screen was shown.
5. Check Home Assistant is working as expected
The process to restore Home Assistant is now completed. But wise to do some checks everything is working as expected. If this is not the case a solution could be to follow the whole process again from the beginning and restore an earlier backup.
- Login and do some checks if everything is working as expected:
a. Dashboards as expected
b. Test some light switches for example
c. Check the add-ons are operational and for sure the OneDrive Backup addon or similar one you are using. Check logs of critical add-ons for possible errors and fix them.
d. Perform latest updates if available - Check notifications if some integration(s) require reconfiguration. In my case MQTT required a “reconfiguration”:
Just clicked SUBMIT and problem solved.
- Reboot Home Assistant to confirm it is working fine.
- Monitor the next days that the backups are being created and uploaded to ONEdrive.
0 Comments