logo smart home family kruse

Kruse Smart Home

Easy living in our smart home & Garden

Restore Home Assistant backup after a failure

Restore Home Assistant after a failure

1 October 2024

Jan-Willem

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.

  1. 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.
  2. Go to https://www.raspberrypi.com/software/ and download the “Raspberry Pi Imager” for Windows. Install the software.
  3. Run the “Raspberry Pi Imager”
  4. 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.
  5. Click Yes to confirm overwriting the SSD

    The Home Assistant OS image will now be written to the SSD and then verified.
  6. When a similar message as below is shown, safely disconnect the SSD from Windows.

    The Raspberry Pi imager software can now be closed.
  7. 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

 

  1. Plug in the Ethernet cable.
  2. 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.

  1. A few minutes after the Raspberry Pi was started the Home Assistance instance can be reached via http://homeassistant.local:8123
  2. The screen shown in your browser will look like the one below. Click on the “RESTORE FROM BACKUP” link.
  3. Click on “UPLOAD BACKUP” to upload the backup file from your computer to the freshly installed Home Assistant instance.
  4. 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.
  5. 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.

 

  1. 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
  2. Check notifications if some integration(s) require reconfiguration. In my case MQTT required a “reconfiguration”:
     


    Just clicked SUBMIT and problem solved.
  3. Reboot Home Assistant to confirm it is working fine.
  4. Monitor the next days that the backups are being created and uploaded to ONEdrive.
Article by <a href="https://smarthome.familykruse.eu/author/iamjwk/" target="_self">Jan-Willem</a>

Article by Jan-Willem

Position

Writen by the website owner

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *