Backup


The Backup integrationIntegrations connect and integrate Home Assistant with your devices, services, and more.
[Learn more]
allows you to create and download backups for your Home Assistant CoreHome Assistant Core is the heart of Home Assistant itself. It is a Python program that powers every installation type, but can be installed standalone.
[Learn more]
and Home Assistant ContainerHome Assistant Container is a standalone container-based installation of Home Assistant Core. Any OCI compatible runtime can be used, but the documentation focus is on Docker.
[Learn more]
installations. This backup file can be used if you migrate to Home Assistant Operating SystemHome Assistant OS, the Home Assistant Operating System, is an embedded, minimalistic, operating system designed to run the Home Assistant ecosystem. It is the recommended installation method for most users.
[Learn more]
.

If you use Home Assistant Operating SystemHome Assistant OS, the Home Assistant Operating System, is an embedded, minimalistic, operating system designed to run the Home Assistant ecosystem. It is the recommended installation method for most users.
[Learn more]
or Home Assistant SupervisedHome Assistant Supervised is the full Home Assistant ecosystem, without the Home Assistant Operating System.
[Learn more]
, the back up functionality is already built-in. This integration is for Home Assistant CoreHome Assistant Core is the heart of Home Assistant itself. It is a Python program that powers every installation type, but can be installed standalone.
[Learn more]
and Home Assistant ContainerHome Assistant Container is a standalone container-based installation of Home Assistant Core. Any OCI compatible runtime can be used, but the documentation focus is on Docker.
[Learn more]
installations.

Services

The Backup integration exposes a service that can be used to automate the backup process.

Service backup.create

The backup.create service can be used to create a backup for your Home Assistant instance.

The service has no additional options or parameters.

Example service call:

service: backup.create

Example: Backing up every night at 3:00 AM

This is a YAML example for an automation that initiate a backup every night at 3 AM:

automation:
  - alias: "Backup Home Assistant every night at 3 AM"
    trigger:
      platform: time
      at: "03:00:00"
    action:
      alias: "Create backup now"
      service: backup.create

Restoring a backup

Backups created via the Backup integration are in a subdirectory backups, located in your configuration directory. The Home Assistant ContainerHome Assistant Container is a standalone container-based installation of Home Assistant Core. Any OCI compatible runtime can be used, but the documentation focus is on Docker.
[Learn more]
installation typically mounts this directory via docker-compose.yml or docker run to a directory of your choice.

The steps on recovering from a backup depend on the installation type and use case. Follow one of these steps:

  1. If you use Home Assistant Operating SystemHome Assistant OS, the Home Assistant Operating System, is an embedded, minimalistic, operating system designed to run the Home Assistant ecosystem. It is the recommended installation method for most users.
    [Learn more]
    or Home Assistant SupervisedHome Assistant Supervised is the full Home Assistant ecosystem, without the Home Assistant Operating System.
    [Learn more]
    :

  2. If you use a Home Assistant CoreHome Assistant Core is the heart of Home Assistant itself. It is a Python program that powers every installation type, but can be installed standalone.
    [Learn more]
    or Home Assistant ContainerHome Assistant Container is a standalone container-based installation of Home Assistant Core. Any OCI compatible runtime can be used, but the documentation focus is on Docker.
    [Learn more]
    installation:

    • A Home Assistant backup is just a tar file of the configuration directory, plus some metadata.

    • To manually restore a backup, use the following command:

         tar -xOf <backup_tar_file> "./homeassistant.tar.gz" | tar --strip-components=1 -zxf - -C <restore_directory>
      
  3. If you migrate from a Home Assistant CoreHome Assistant Core is the heart of Home Assistant itself. It is a Python program that powers every installation type, but can be installed standalone.
    [Learn more]
    or Home Assistant ContainerHome Assistant Container is a standalone container-based installation of Home Assistant Core. Any OCI compatible runtime can be used, but the documentation focus is on Docker.
    [Learn more]
    installation to Home Assistant Operating SystemHome Assistant OS, the Home Assistant Operating System, is an embedded, minimalistic, operating system designed to run the Home Assistant ecosystem. It is the recommended installation method for most users.
    [Learn more]
    :

    • You can use these backup files during onboarding to recover your installation from backup.

Related topics