Quick answer
Create backups under Settings > System > Backups, keep at least one copy somewhere other than the device, and test a restore now and then. A backup you have never restored is not yet proven.
What a backup includes
A Home Assistant backup is a .tar archive. Depending on your options, it can include:
- Your configuration files
- The database, which holds your history (optional)
- Apps and their data, on Home Assistant OS and Supervised installs
- The share and media folders, if you choose to include them
Container and Core installs back up only the configuration and database, because apps are not part of those installs.
Backups do not include the operating system itself. If you are rebuilding a system, reinstall the operating system first, then restore the backup.
Create a backup
- Open Settings > System > Backups.
- Select the option to create a new backup, and choose a full backup or a partial one.
- Wait for it to finish, then check that it appears in the list.
On Home Assistant OS, you can also create a named backup from the console:
ha backups new --name "pre-update"
Schedule backups and choose where they go
- Schedule. Run backups daily, or on the weekdays you choose.
- Retention. Choose how many copies to keep, or how many days.
- Locations. Local storage (the
/backupfolder), a network storage location (NAS), Home Assistant Cloud, and cloud integrations such as Google Drive or OneDrive where your version offers them. Availability varies, so check what your version lists.
A backup on the same disk as Home Assistant is not a real safety net, because a disk failure takes both copies. Keep at least one copy off the device. The 3-2-1 rule is a good target: three copies, on two kinds of storage, with one copy off-site.
Protect the encryption key
Newer releases encrypt new backups by default. Save the emergency kit, or the encryption key, somewhere safe and separate from the backup files. An encrypted backup cannot be restored without its key. Neither Nabu Casa nor anyone else can recover that key for you.
Unencrypted copies contain secrets and access tokens, so protect them as well.
Restore on a running system
- Open Settings > System > Backups and select the backup.
- Choose Restore, then pick a full restore or only the parts you need.
- Confirm. Home Assistant restarts and finishes the restore.
On Home Assistant OS, you can also restore from the console. Use the backup’s ID (its slug) from ha backups list:
ha backups restore <slug>
Restore on new hardware
Use the restore option during onboarding on the new device:
- Install Home Assistant on the new device and start it.
- Choose the option to restore from a backup.
- Upload your backup file, or sign in to pull a cloud backup if your version supports it.
- Wait. A large setup can take a long time while apps and components reinstall.
Move your Zigbee or Z-Wave USB radio to the new device too. If you do not, your devices may need to be paired again.
Restore a Container or Core install
Container and Core installs do not have the same restore menu. The restore is a manual copy: stop Home Assistant, then copy the contents of the backup’s data folder into your configuration folder. Include hidden folders such as .storage and .cloud.
Do not restore into an older Core version than the one that made the backup. That combination is not supported.
Test your backups
A backup is proven only when you restore it. To test one:
- Restore into a spare device or a virtual machine, not your live system.
- Check that your automations, dashboards and devices work.
- Store the encryption key or emergency kit where you can find it, and check that you can open it.
Common mistakes
- Copying only the
configfolder. That misses app data and the database. - Keeping every backup on one disk. A single drive failure can take all of them.
- Restoring into an older Core version. This is not supported, so keep Core at or above the version that made the backup.
- Losing the encryption key. Without it, an encrypted backup cannot be restored.
If Home Assistant will not start after a change, see why you can’t connect to your Home Assistant. If you have lost your login, see how to reset your Home Assistant password.