> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agent.golf/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade Uplink

> Upgrade a Self-Hosted Uplink instance to a new release, and roll it back.

Install the new release in the same way as the first install, and keep the state directory. Agent Golf runs the Cloud Uplink instance, so it needs no upgrade from you.

## Before you upgrade

1. Find the release of each uplink instance. The instance page in the **Uplink** section of the dashboard shows its version. On the host, run `uplink -version`.
2. Read [Changes that need action](#changes-that-need-action), and do the steps for each release after yours, up to the release that you install.
3. Make sure that the [state directory](https://docs.agent.golf/uplink/overview.md#state-directory) is on a persistent disk. It holds the session data, the encryption keys, and the ID of the instance.

## Minimum release

Use Uplink 0.1.22 or later. Agent Golf cannot link the sessions of an earlier release to a publishing key, so it does not accept them. The earlier instance can still look healthy.

## Changes that need action

| Release | Change | What to do |
| - | - | - |
| 0.1.46 | Uplink refuses an export with a revoked publishing key with HTTP 401. The harness does not retry, so the data is lost. | Before the upgrade, make sure that no user still sends data with a revoked key. Such a user creates a new key, runs `agentgolf harness setup`, and restarts each running harness. See [The harness gets HTTP 401](https://docs.agent.golf/uplink/troubleshooting.md#the-harness-gets-http-401). |
| 0.1.38 | Uplink deletes the old analysis data that it no longer uses. | From 0.1.34 or earlier, first upgrade to 0.1.35 and let it start once. 0.1.38 does not start while an old store still holds data, and its log names that store. After the upgrade, roll back only to 0.1.37 or later. |
| 0.1.37 | Uplink deletes the last old store that 0.1.35 emptied. | From 0.1.34 or earlier, first upgrade to 0.1.35 and let it start once. 0.1.37 does not start while that store still holds data, and its log names that store. After the upgrade, roll back only to 0.1.35 or later. |
| 0.1.36 | Uplink deletes the old stores that 0.1.35 emptied. | From 0.1.34 or earlier, first upgrade to 0.1.35 and let it start once. 0.1.36 does not start while an old store still holds data, and its log names that store. After the upgrade, roll back only to 0.1.35 or later. |
| 0.1.35 | Uplink no longer copies a stored history of 0.1.30 or earlier into its database, and it no longer reads `UPLINK_PLAINTEXT_SWEEP_OFF`. | From 0.1.30 or earlier, first upgrade to 0.1.34, and wait until its log shows three lines that contain `hold every`. 0.1.35 stops session storage on a history that it did not copy, and its log names 0.1.34. Remove `UPLINK_PLAINTEXT_SWEEP_OFF` and `-plaintext-sweep-off` before the upgrade: the chart refuses the value, and Uplink refuses the flag. After the upgrade, roll back only to 0.1.32 or later. |
| 0.1.33 | Uplink frees the copy of the stored history that 0.1.32 kept. | After the upgrade, roll back only to 0.1.32 or later. |
| 0.1.32 | Uplink keeps the stored sessions in an embedded database. The first start copies the stored history into it. | Before the upgrade, keep free disk of the store size plus 1.6 GiB for each compaction thread (`UPLINK_RECORD_STORE_THREADS`). Back up the state directory only as [State directory](https://docs.agent.golf/uplink/overview.md#state-directory) tells. After the upgrade, roll back only to 0.1.29 or later. |
| 0.1.30 | Uplink deletes the plaintext copy of a prompt, response, or tool detail about two hours after its last use, once the content has an encrypted copy. | After the upgrade, roll back only to 0.1.29 or later. In 0.1.30 to 0.1.34, `UPLINK_PLAINTEXT_SWEEP_OFF=true` stops the deletion before a rollback. |
| 0.1.24 | Uplink refuses each export without a well-formed user publishing key with HTTP 401. The harness does not retry, so the data is lost. | Before the upgrade, give each user a publishing key, run `agentgolf harness setup`, and restart each running harness. See [Require a publishing key](https://docs.agent.golf/uplink/install.md#require-a-publishing-key). |

## Install the new release

Use the same method as in [Install and start Uplink](https://docs.agent.golf/uplink/install.md#install-and-start-uplink).

| Installation | Upgrade |
| - | - |
| Docker | Remove the container. Run it again with the new tag, the same key, and the same volume. |
| Kubernetes | Run `helm upgrade` with the new `--version` and all the values of your installation. |
| Linux and macOS | Run the install script again, then restart Uplink, for example with `sudo systemctl restart uplink`. |

For Kubernetes, pass all the values of your installation again. When a `helm upgrade` command sets any value, Helm drops the earlier values that the command does not pass, and each one goes back to the chart default. For example, TLS on the OpenTelemetry listener and the network policy turn off. If you do not keep a values file, save the current values first:

```bash theme={null}
helm get values uplink --namespace uplink --output yaml > uplink-values.yaml
helm upgrade uplink oci://ghcr.io/agentgolf/charts/uplink --version <version> \
  --namespace uplink \
  --values uplink-values.yaml
```

The chart version and the Uplink version are the same number. Always set `--version`, so that each uplink instance stays on a known release.

The chart keeps the size of the existing volume, also when `persistence.size` has another value. Argo CD and `helm template` cannot read the cluster, so they use `persistence.size`. With them, set `persistence.size` to the size of the existing volume claim template, or Kubernetes refuses the update. Earlier chart versions installed `20Gi` by default. The chart README shows how to read the size.

Uplink updates its data store when it starts. You do not run a separate step.

## After you upgrade

1. Confirm that Uplink is ready. See [Verify the installation](https://docs.agent.golf/uplink/verify.md#check-that-uplink-is-ready).
2. Confirm that the instance page shows the new version. Uplink reports about once a minute.
3. Confirm that new sessions arrive in **Sessions**.

## Roll back

Install the earlier release in the same way, with the same state directory:

* On a host, set `UPLINK_VERSION` to the earlier release when you run the install script, then restart Uplink.
* In Docker, run the container again with the earlier tag.
* In Kubernetes, run `helm upgrade` with the earlier `--version` and the same values file. Earlier chart versions do not keep the size of the existing volume, so set `persistence.size` to the size of the existing volume claim template.

Do not roll back below the [minimum release](#minimum-release), or below a release that the [changes that need action](#changes-that-need-action) forbid.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.