# Update

> Update a Corfedo installation to a new release, continue an interrupted update and apply changed settings.

Source: https://docs.corfedo.ai/operate/single-host/update/

An update downloads and verifies the release, takes a recovery set and starts the new release. If the new release does not become ready, the installer restores the recovery set and starts the previous release.

## Before you begin

- Plan a maintenance window. Corfedo stops while the recovery set is taken and the release starts.
- Free disk for a recovery set: the installation directory and the data volumes. Run `status` first and check it says `Ready.`

## Update to the latest release

```sh
sh ~/corfedo/install.sh update
```

To choose a release, add `--version`, such as `--version 0.3.2`. The same update also runs through `curl -fsSL https://get.corfedo.ai | sh -s update`.

Each release names the releases it updates from, and `update` refuses any other before anything stops. The installer downloads the images while Corfedo runs, then stops it, takes a recovery set in `backups/` and starts the new release. It also renews Corfedo's internal certificates that expire within 90 days. If the new release does not start, it restores the previous one.

**Check:** the installer ends with `Corfedo is updated to <version>. The recovery set is …`, and `status` says `Ready.`

## Continue an interrupted update

An update interrupted by Ctrl-C, a lost connection or a reboot continues when you run `update` again for the same release. `status` names it with the command to run:

```text
Unfinished update: 0.3.1 to 0.3.2; run update --version 0.3.2 to continue it.
```

If it still fails, the installer restores the recovery set it took before the interruption. Each update adds a recovery set to `backups/`, which [Cleanup and uninstall](https://docs.corfedo.ai/operate/single-host/cleanup-and-uninstall/) removes.

## Apply changed settings

Running `update` for the installed release applies its configuration again. Use it after changing `.env` or files in `generated/`:

```sh
sh ~/corfedo/install.sh update --version "$(cat ~/corfedo/VERSION)"
```

[Installation settings](https://docs.corfedo.ai/operate/settings/) lists the settings.

## Troubleshooting

| What you see | Why | What to do |
| --- | --- | --- |
| `Corfedo 0.4.1 updates from 0.3.2, 0.4.0, not from 0.2.5` | The installed release is too old for this release | Update to one of the named releases first with `--version` |
| `The update to … failed and Corfedo … was restored` | The new release did not become ready | Copy the installer output above the warning that the update failed, because the failed release's container logs are gone after the rollback. Then try again or report it. `cleanup` lists the directory and data generation the rollback left. |
| `Pulling … failed` | The host cannot reach the image registry | Check the network and run `update` again |
| `Bundle checksum mismatch` | The download was damaged or changed | Run `update` again |
| `--certificate applies only to a new installation` | Install options such as `--host` or `--certificate` set up a new installation, and `update` refuses them | Change the setting where the message names it, then run `update` for the installed release |

## Related

- [Backup and recovery](https://docs.corfedo.ai/operate/single-host/backup-and-recovery/) restores a recovery set later.
- [Status and troubleshooting](https://docs.corfedo.ai/operate/single-host/troubleshooting/).
