Tools & Add-onsPVE Tools
core-restore-from-backup
Restore a Home Assistant backup archive into /root/.homeassistant of a Home Assistant Core LXC.
core-restore-from-backup.sh unpacks a Home Assistant backup into the configuration directory of a Home Assistant Core installation. It is not listed on the website.
Despite its location in tools/pve/, it runs inside the Home Assistant Core LXC, not on the host. If pveversion exists it prints "Can't Run from the Proxmox Shell" and exits.
Source: tools/pve/core-restore-from-backup.sh.
Run
In the console of the Home Assistant Core LXC, as root:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/core-restore-from-backup.sh)"Requirements
- Home Assistant Core with its configuration in
/root/.homeassistantand a service namedhomeassistant. - At least one backup file in
/root/.homeassistant/backups/. Without one the script exits with 235 ("No backups found!"). sudo, which the script uses to stop and start the service.
Prompts
| Prompt | Input | Effect |
|---|---|---|
This will restore Home Assistant Core from a backup. Proceed(y/n)? | y / n | n exits. |
Please enter your choice: | Number of a file in the backups directory | The archive to restore. |
What it does
- Creates
/root/.homeassistant/restoreif it does not exist. sudo service homeassistant stop- Extracts the chosen archive into the
restoredirectory, then extracts thehomeassistant.tar.gzit contains. - Installs
rsyncwithapt-getif it is missing. rsync -acopiesrestore/data/over/root/.homeassistant.- Empties the
restoredirectory. sudo service homeassistant start
Environment variables
| Variable | Default | Purpose |
|---|---|---|
COMMUNITY_SCRIPTS_CORE_URL | https://raw.githubusercontent.com/community-scripts/core/main | Base URL the script loads api/api.func from. |
Limits
- Existing configuration files are overwritten by the ones from the backup. Files that are not in the backup stay. There is no undo; take a snapshot of the LXC first.
- The archive must contain an unencrypted
homeassistant.tar.gz. - Only the configuration directory is restored. The installed Home Assistant Core version is not changed.
- File names with spaces in the
backupsdirectory break the selection list.