# Failover between storages

> Give a plan a second storage that takes the backup when the first one fails, and choose the folder each plan writes to.

A plan can have several storages. Each backup goes to one of them: the first in order that accepts it. Clokeep does not copy a backup to more than one storage.

## Prerequisites

- A Clokeep account with the Admin or Operator role.
- Two or more storages. See [S3](/docs/storage/s3), [SFTP](/docs/storage/sftp) and [FTP](/docs/storage/ftp).

## Add a second storage to a plan

<Steps>
<Step title="Open the plan">
Open **Plans** and click the plan. Scroll to the **Storages** section: "Where backups are uploaded. Storages are tried in order until one accepts the upload."
</Step>
<Step title="Add the storage">
Click **Add storage**. In the new row, fill in:

- **Storage**: the second storage. A storage already on the plan cannot be picked twice.
- **Order**: `2`. The storage with **Order** 1 is tried first.
- **Folder**: the folder on this storage for this plan. Left empty, it is `backups`.
</Step>
<Step title="Save">
Click **Save changes**. The next run uses the new order.
</Step>
</Steps>

## What happens when a storage fails

The agent uploads each archive to the storage with the lowest **Order**.

When an upload fails for a reason that can pass, such as a dropped connection or a timeout, the agent tries the same storage again. It retries three times by default, with a growing pause between tries, up to a minute. Each retry adds a line to the run's **Logs**:

```text Run log
Upload of website-files-2026-11-27-020000.tar.zst to Offsite S3 failed (attempt 1/4): … Retrying in 5s.
```

Some errors do not pass on their own: wrong credentials, access denied, a missing bucket, a refused folder, or an SFTP host key that changed or was never pinned. The agent does not retry those and moves to the next storage at once.

When the agent gives up on a storage, it moves to the next one in order and logs it:

```text Run log
Upload of website-files-2026-11-27-020000.tar.zst to Offsite S3 failed: … Trying the next storage, Storage Box.
```

The next storage gets the same retries. If no storage accepts the archive, the run fails. On a plan that backs up hosting accounts, that account fails and the run can end as **Partially completed**.

The index of a backup always goes to the same storage as its archive. It does not fail over.

### Where to look

The run page does not name the storage a backup went to. Read the run's **Logs** for the lines above. When the first storage took the backup, the Logs show no storage line. A storage's page also shows its **Last upload**.

### The next run

Every archive starts again at the storage with **Order** 1. When the first storage works again, the next backup goes back to it. Backups already on the second storage stay there.

## Restores, retention and downloads

Clokeep remembers which storage holds each backup. A restore, a download, retention and the hourly check that a backup still exists all use that storage. A plan's backups can be spread across its storages, and each one is read from or deleted on the storage it is on.

## Folders on a storage

A backup's location on a storage is built from three parts: the storage's **Root path**, the plan's **Folder** for that storage, and the archive's name. For example, a **Root path** of `/home/backups` and a **Folder** of `web-01/files` put the archive under `/home/backups/web-01/files/`.

The **Folder** is set per plan and per storage, so several plans can share one storage, each in its own folder. Its rules:

- Letters, digits, dots, dashes, underscores and slashes only.
- A relative path, such as `backups/web01`. It cannot start with `/`.
- No `.` or `..` parts.
- No empty parts and no trailing `/`.
- At most 255 characters.

The agent creates the folders it needs.

## Switch a storage off

On the storage's page, turn off **Is active** and click **Save changes**. Plans stop uploading to it from their next run. Incremental backups still read earlier indexes from it. In a plan's **Storages** list it shows as "(switched off)".

A plan with no other active storage cannot run. After you save, a **Plans left without storage** message names those plans.

## Next steps

<CardGroup cols="2">
<Card title="How Clokeep works" href="/docs/how-clokeep-works" icon="book">
What connects to your storage, and when.
</Card>
<Card title="Plans" href="/docs/backups/plans" icon="play">
Create a plan that uploads to your storages.
</Card>
</CardGroup>
