Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update backup integration docs to reflect current SW #36684

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 9 additions & 25 deletions source/_integrations/backup.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ ha_codeowners:
ha_iot_class: Calculated
ha_integration_type: system
related:
- docs: /installation/#advanced-installation-methods
title: Home Assistant installation methods
- docs: /common-tasks/general/#backups
title: Backups
- docs: /getting-started/onboarding/
title: Recover from backup during onboarding
- docs: /docs/configuration/
title: Configuration file
- docs: /common-tasks/os/#restoring-a-backup
title: Home Assistant Operating System- Restoring a backup
- docs: /more-info/backup-emergency-kit/
title: backup emergency kit
---

The **Backup** {% term integration %} is used for {% term "Home Assistant Core" %} and {% term "Home Assistant Container" %} installations to create and download backups. This backup file can be used if you migrate to {% term "Home Assistant Operating System" %}.
The **Backup** {% term integration %} is used by all [installation types](/installation/#advanced-installation-methods) to create and restore backups.

Note: If you use {% term "Home Assistant Operating System" %} or {% term "Home Assistant Supervised" %} installation, this page is not for you. Instead, refer to the documentation on using the [built-in back up](/common-tasks/general/#backups).
To learn how to create and restore a backup, refer to the backup section under [common tasks](/common-tasks/general/#backups).

## Actions

The **Backup** integration exposes an action that can be used to automate the backup
process.

However, it is no longer needed to create your own automation. Follow these steps to [set up an automatic backup from the UI](/common-tasks/general/#setting-up-an-automatic-backup-process).

Comment on lines +31 to +32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

The link to automatic backup setup is incorrect

The documentation refers to /common-tasks/general/#setting-up-an-automatic-backup-process, but the actual content is included from source/_includes/common-tasks/backups.md and the correct anchor is #setting-up-an-automatic-backup-process. The link should be updated to point to the correct location.

  • Update the link in source/_integrations/backup.markdown to: /common-tasks/backups/#setting-up-an-automatic-backup-process
🔗 Analysis chain

Excellent guidance on preferred backup method!

The update appropriately directs users to the UI-based setup while maintaining YAML documentation for advanced users.

Let's verify the UI setup link is valid:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the UI setup link exists in the documentation
rg -l "setting-up-an-automatic-backup-process" "source/common-tasks/"

Length of output: 67


Script:

#!/bin/bash
# Let's check if the common-tasks directory exists and its contents
fd "common-tasks" source/

# Let's also check for any file containing "backup" in the common-tasks path
fd ".*" source/common-tasks/ -t f

# Let's search for the anchor text in all markdown files
rg -l "setting.*up.*automatic.*backup" "source/"

# Let's also check for the general.md file specifically
fd "general.md" source/

Length of output: 489


Script:

#!/bin/bash
# Let's check the content of general.markdown for the backup section
rg -A 5 -B 5 "setting.*up.*automatic.*backup" "source/common-tasks/general.markdown"

# Let's also check if there's a different heading or section about backups
rg "backup" "source/common-tasks/general.markdown"

Length of output: 171


Script:

#!/bin/bash
# Let's check the included backups.md file content
rg -A 5 -B 5 "setting.*up.*automatic.*backup" "source/_includes/common-tasks/backups.md"

# Also check if this file exists
fd "backups.md" "source/_includes/common-tasks/"

Length of output: 176


Script:

#!/bin/bash
# Let's check the actual content of the backups.md file
cat "source/_includes/common-tasks/backups.md"

# Also check if there's any other file that might contain the backup setup instructions
rg -l "automatic.*backup" "source/more-info/"

Length of output: 14263

### Action {% my developer_call_service service="backup.create" %}

The {% my developer_call_service service="backup.create" %} action can be used
Expand Down Expand Up @@ -61,20 +61,4 @@ automation:
## Restoring a backup
Backups created via the **Backup** integration are in a subdirectory `backups`, located in your [configuration directory](/docs/configuration/#editing-configurationyaml).
The {% term "Home Assistant Container" %} 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 {% term "Home Assistant Operating System" %} or {% term "Home Assistant Supervised" %}:
- Follow the steps described in [Restoring a backup](/common-tasks/os/#restoring-a-backup).
2. If you use a {% term "Home Assistant Core" %} or {% term "Home Assistant Container" %} installation:
- A Home Assistant backup is just a tar file of the [configuration directory](/docs/configuration/#editing-configurationyaml), plus some metadata.
- To manually restore a backup, use the following command:

```shell
tar -xOf <backup_tar_file> "./homeassistant.tar.gz" | tar --strip-components=1 -zxf - -C <restore_directory>
```

3. If you migrate from a {% term "Home Assistant Core" %} or {% term "Home Assistant Container" %} installation to {% term "Home Assistant Operating System" %}:
- You can use these backup files during [onboarding](/getting-started/onboarding/) to recover your installation from backup.
To restore a backup, follow the steps described in [Restoring a backup](/common-tasks/os/#restoring-a-backup).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider using a more general restoration guide link

The current link points to OS-specific restoration documentation (/common-tasks/os/#restoring-a-backup), which seems inconsistent with the goal of making the documentation more general across all installation types.

Consider updating to point to a more general restoration guide:

-To restore a backup, follow the steps described in [Restoring a backup](/common-tasks/os/#restoring-a-backup).
+To restore a backup, follow the steps described in [Restoring a backup](/common-tasks/general/#restoring-a-backup).

Committable suggestion skipped: line range outside the PR's diff.

Loading