Backup and Restore: Automatic Backups You Can't Move Forward Without

Module 23 · Lesson 2

Backup and Restore: Automatic Backups You Can't Move Forward Without

A Raspberry Pi SD card failure with no current backup means losing months of work on the automations, dashboards, and integrations from this entire course. This lesson covers configuring Home Assistant's built-in automatic backups, where to store them following the 3-2-1 rule, and how to actually test a restore, not just running the backup itself.

Budget around 55 minutes. This is the most important lesson in the whole module: without a trustworthy backup, every other maintenance task (an update, a migration, installing a HACS integration) carries unnecessarily high risk.

A Real-Life Problem: The SD Card Dies, There's No Backup

SD cards in a Raspberry Pi have a limited number of write cycles and wear out over time, especially under the heavy recorder database writes covered in Lesson 4. When the card dies and there's no backup, you don't just lose files, you lose weeks of work: every automation from Module 11, every dashboard from Modules 13 through 15, every configured integration. Rebuilding it from scratch takes far longer than setting up backup once, at the very start.

Automatic Backups: What Changed in Home Assistant 2025

Since version 2025.1, Home Assistant has a rebuilt backup system with an automatic schedule, retention policies, and a setup wizard, available under Settings, System, Backups. Instead of remembering to run a backup by hand, you set the frequency once (daily or weekly, say) and how many versions to keep, and the system handles the rest on its own.

Storage locationCharacteristics
Local (on the same hardware)fastest, but useless if the device itself physically fails
Home Assistant Cloud (Nabu Casa)5 GB of space included with the subscription, fully encrypted copy, only the newest version is kept, single-backup size capped at 5 GB
Google Drive / Microsoft OneDrivealternative external locations, can be combined with other locations
A NAS on the local network (Synology, for example)a good complement to a cloud copy, especially for larger backups that exceed the cloud limit

The 3-2-1 Rule
Three copies of your data, on two different kinds of media, with one of them off-site. In practice for Home Assistant: a local copy on the same hardware, a copy on a NAS on the home network, and a cloud copy (Home Assistant Cloud, Google Drive, or OneDrive) as the off-site one, protecting you even against a fire or a flood.

A Notification When a Backup Fails

The schedule alone isn't enough if you don't know something went wrong. Home Assistant exposes an entity reporting the state of the last backup, which you can wire into a notification automation, following the same pattern as Module 18 (home security).

automation:
  - alias: "Maintenance: backup failed"
    id: maintenance_backup_failed
    mode: single
    triggers:
      - trigger: state
        entity_id: sensor.backup_manager_state
        to: "error"
    actions:
      - action: script.home_announcement
        data:
          message: "The last automatic Home Assistant backup failed. Check your backup settings."
      - action: notify.mobile_app_your_phone
        data:
          title: "Backup failed"
          message: "Check Settings, System, Backups.

The Restore Test: The Step Most People Skip

A backup you've never restored is a theoretical backup
Just running the backup gets you nothing if the restore process fails the moment you actually need it. Every few months it's worth testing a restore on spare hardware (an old Raspberry Pi, a virtual machine), or at least checking that the backup file even opens and has a sensible size.

The test doesn't need to be a full disaster simulation: it's enough to download the latest backup file from Settings and check that its size matches expectations (a sudden drop in size compared to earlier copies is a warning sign that something wasn't saved correctly).

Full Versus Partial Backup: What Exactly Gets Included

Home Assistant's backup wizard lets you choose exactly what goes into a copy: a full backup includes the configuration, the recorder database, media, and images of every installed add-on, while a partial backup (configuration only, say) is much smaller and faster, but won't restore add-on state or history. For most home installs, a sensible practice is one full backup a week and, if disk space matters to you, more frequent configuration-only backups.

It's worth remembering that a partial backup without recorder data means losing history and energy statistics after a restore, even if the configuration and automations themselves come back without issue. If the Energy dashboard from Module 17 matters to you, a full backup is worth the extra disk space.

Backup Encryption: Default and Recommended, Not Optional

Home Assistant backups have been encrypted by default since version 2025.1, with a password you set yourself during initial setup. That matters, because the backup file contains your full configuration, often including login credentials for cloud integrations, API tokens, and the addresses of devices on your home network. An unencrypted backup stored in the cloud would, in practice, be a ready-made data package for anyone who gained access to it.

Save your encryption password somewhere safe, separate from the backup itself
If you forget the encryption password, there's no way to recover or bypass it: the backup, though physically sitting on a disk or in the cloud, becomes useless. The best practice is saving it in a password manager, the same one you use for other accounts tied to your smart home.

Step by Step: What an Actual Restore Looks Like

1. On the setup screen of a new or reset Home Assistant install, choose the restore-from-backup option instead of creating a new account.

2. Point it at the backup file, either locally from disk or directly from a connected cloud provider (Home Assistant Cloud, Google Drive).

3. If the backup was encrypted, enter the encryption password used when it was created, without it a restore isn't possible.

4. The system automatically restores the configuration, the database, and add-ons, then restarts with the full state from before the backup.

5. After the restart, check System Health and Repairs (Lesson 5) to confirm every integration came back correctly.

Common Causes of a Failed Restore

A forgotten backup encryption password: without it, an encrypted copy can't be opened at all, which is why it's worth saving it in a password manager

A backup file too large for the cloud limit: Home Assistant Cloud accepts files up to 5 GB, larger backups need a local or NAS location

An incomplete backup file after an interrupted transfer: worth verifying with a checksum, or simply the file size, after downloading

A version mismatch when restoring a very old backup: on a newer Home Assistant version, the data migration process may need extra time

Retention: How Many Versions Are Worth Keeping at Once

The backup schedule is one thing, and the retention policy, the number of versions kept at once, is another. Keeping only a single, most recent copy means that if a configuration problem goes unnoticed for a few days, and the backup gets overwritten in the meantime, you lose the ability to roll back to the state before the problem started. A reasonable compromise for a home install is keeping the last 3 to 5 copies locally and at least one copy older than a week in an external location: enough to roll back several days without filling up the disk.

A backup before every risky change, not just on schedule
Beyond the automatic schedule, it's worth building the habit of a manual backup right before any higher-risk operation: an update (Lesson 3), installing a new HACS integration (Lesson 9), or a hardware migration (Lesson 7). That one extra click costs less than a minute, and can save hours of rebuilding a configuration from scratch.

Backup as Part of a Pre-Trip Checklist

Before a longer trip, when the house is left unattended and the automations from Modules 18 and 21 take over security and irrigation, it's worth adding a fresh backup to your pre-trip checklist, alongside standard tasks like closing windows or setting Away mode. This is the moment system stability matters most, since for the next several days you won't be able to react to a problem in person right away.

How to Test This Lesson

1. Configure automatic backups under Settings, System, Backups with a schedule and at least one external location.

2. Add an automation notifying you of a failed backup, using this lesson's example.

3. Download the latest backup file by hand and check that its size looks reasonable.

Common Mistakes

A local-only backup, with no off-site copy: useless in a fire, a flood, or a hardware theft

No notification for a failed backup: the system stays silent for weeks before anyone notices there's no current copy

A restore that's never been tested: confidence in the backup stays purely theoretical, only checked in the middle of a crisis

Practical Task

☐ Set up an automatic backup schedule with retention of at least a few versions.

☐ Add at least one storage location off the Home Assistant device itself.

☐ Roll out an automation notifying you of a failed backup.

Key Takeaways

Automatic backups have been built into Home Assistant since 2025.1, with a schedule and retention policies.

The 3-2-1 rule: three copies, two kinds of media, one location off-site.

A backup without a restore test is a purely theoretical backup.

What's Next

Next lesson: Updates: Core, Supervisor, OS, and Add-Ons Without Surprises. With a trustworthy backup from this lesson, updates stop being risky.

Finished this lesson?