Guide: Home Assistant Core - Restoring a Backup

Home Assistant Core does not have an automated retort process and must be restored manually. These steps work if you’re restoring from any install type of Home Assistant to Core. Personally, i’ve used this to convert my setup of Home Assistant Docker to Home Assistant Core

To do this:

  1. Login to Home Assistant
  2. Go to Settings > System > Backups
  3. Click Create Backup - It will take a few minutes depending on your setup
  4. Once the backup is created, click the Download button against your backup and download to your computer
  5. A file will be created such as “core_2022_12_9.tar” - At this point you can either untar and gunzip the files or upload the files and uncompress the files on your Home Assistant. You can do this a few ways, my recommendation is to enable SAMBA.
    1. Untar this file and folder will be created with a backup metadata file and a homeassistant.tar.gz - This second file contains the backup data
    2. Gunzip homeassistant.tar.gz and a data folder is created - This is where your configuration backup now resides
    3. The data folder contains the backup - If you’ve uncompressed on your computer, copy the folder over, don’t just copy the files as there are hidden directories in this folder.
  6. Change directory to /home/homeassistant/.homeassistant
  7. Copy the files from the data directory to /home/homeassistant/.homeassistant: sudo cp -rf [path to data] .
  8. Copy the .storage folder to /home/homeassistant/.homeassistant : sudo cp -rf [path to data/.storage] .
  9. Copy the .cloud folder to /home/homeassistant/.homeassistant : sudo cp -rf [path to data/.cloud] .
  10. The most important thing to note is the .storage directory that’s hidden is copied over as well - This contains your dashboard data

If you choose to copy the files and directories under data themselves, be sure to show hidden files:

macOS:

  • Open the data folder
  • Press Command + Shift + . (the period key) - This shows hidden files
  • Copy the files over
  • Press Command + Shift + . (the period key) - This hides the hidden files

Windows:

  • Open the data folder in the File Explorer
  • Select View > Show > Hidden items This shows hidden files
  • Copy the files over
  • Select View > Show > Hidden items This hides the hidden files
6 Likes

Well, I am done with HA. It’s garbage. An update deleted all my config and reset me to beginning. I have tried for hours, including this tutorial, to no avail. They have a LOT of work to do. Garbage product. Sorry.

To have a backup that does nothing and cannot be restored is utter silliness.

5 Likes

let me remind you some things…
a) couple of hundred of thousand users are very happy with the software. Perhaps your inability to do something right is the reason of your frustration.
b) it is for free
c) no need to tell us that you are done with the product. It is not an airport.

8 Likes

You write there is no automated restore, but why the start screen of a new HA lets you select a a full backup to restore?

1 Like

Read the topic: Home Assistant Core, that is a Home Assistant installed in a .venv, python only. Only HA OS and HA Supervised show a restore on the start screen.

1 Like

this saved my life, thank you very much!

My situation, using HA in a docker container, new install did not have a restore option on the first login/setup page.

An easier way to do this on Windows is to setup Visual Code:

Then from the backup/downloaded (i.e. saved to your computer) tar file, unzip it a few times as mentioned in the first post of this thread (I used 7zip) until you see a folder structure (in the data folder) similar to what you see using Visual Code. Be sure to show hidden stuff. Then select all the folders/files in the data folder and drag and drop them onto the Visual Code folder area (https://www.youtube.com/watch?v=9rBtmCpYflY) I had a dialog pop up a number of times where I just confirmed what I wanted and it worked to copy all this backup to create a restore onto a new install of HA on a new machine…hope that helps someone.

That is where I am lost. Is there a wiki page that lists the different installation types of HA and their names.

Here are the ones that I’ve done, it someone could fill in the proper name for each one, I’ll add it to my notes as a map of install type to name table.

Installations that I’m aware of

  • Bare Metal
  • Virtual Machine
  • Docker
  • LXC
  • Kubernetes

Bare Metal = HA OS 
Virtual Machine = HA OS 
Docker = HA Container
LXC = HA Container ?
Kubernetes : no idea, I guess you use a docker for that, so HA Container ?

Thanks! That helps a lot. LXC is a linux container that I don’t 100% understand , but it’s very popular with Proxmox users.

Kubernetes supports different container types, and docker is one. Is basically docker + a lot of infrastructure piping to run containers at a large scale. I use it at home for the high availability and gitops features, since I don’t need large scale. Almost everything I run is just one instance of each app. I don’t need hundreds, lol.