# Destinations

Where backups go. The bucket Brewless makes in another region, and second copies at bunny.net Storage, another Scaleway account or any S3 service.


Every environment has one **primary** destination, which Brewless makes, and as many **secondary** destinations as you add. Each destination is a restic repository of its own, opened by the same keys.

## The primary destination

The primary is a bucket in your own Scaleway account, in the same project as the environment but in another region: Paris is backed up to Amsterdam, Amsterdam, Warsaw and Milan to Paris. It has versioning and, unless you chose otherwise, [Object Lock](/backups/retention-and-immutability#object-lock) in Governance mode. Its bucket policy lets only the environment's own backup identities at its objects: your application's storage key cannot read it, and Brewless's own key may change the bucket's settings but not read or write what is in it.

The primary survives losing the environment's region and a stolen application key. It does not survive losing your Scaleway account, because it is in that account.

## Secondary destinations

A secondary is a bucket of your own, somewhere else:

| Kind | What it is |
| --- | --- |
| `bunny` | A bunny.net Storage zone |
| `scaleway` | A bucket in another Scaleway account |
| `s3` | Any S3-compatible service |

After every successful backup, the runner copies the new snapshots from the primary to each secondary with `restic copy`. It does not read your databases and buckets again, and it only copies snapshots that passed their check. The daily maintenance then forgets and prunes on each destination by itself.

### A bunny.net Storage zone with one button

With bunny.net connected under **Providers**, **Backups**, **Destinations**, **Create at bunny.net** makes a storage zone in your own bunny.net account and adds it as a destination. You only give it a name. The zone is in Frankfurt (`DE`), with S3 switched on, without replication. Its S3 endpoint is `https://de-s3.storage.bunnycdn.com`, its name is the access key, and its password the secret key. The password goes straight to your Secret Manager, as below; Brewless keeps neither. bunny.net charges the storage to your account. Asking again with the same name finds the zone it made instead of making a second one.

> [!NOTE]
> bunny.net offers S3 only on zones made with it switched on, and calls it a public preview. A zone you made earlier without S3 cannot be used as a destination.

### Adding a destination by hand

Add one in the console under **Backups**, **Destinations**, **Add destination**, or on the command line:

```bash
brewless backup:destination:add bunny-de --kind=bunny --endpoint=https://de-s3.storage.bunnycdn.com --region=de --bucket=acme-backups
```

It asks for the access key and the secret key. They go straight into the Secret Manager of every environment whose backups are on, under `/brewless-backup/`, where Scaleway mounts them into the backup jobs; Brewless keeps only the reference. The name is a name for you, in lower case letters, digits and dashes; `primary` is taken.

A destination belongs to the organisation. An environment backs up to it once its destinations name it. The narrowest choice wins:

1. The environment's own choice: on the environment's **Backups** tab, under **Destinations**, **Second copy**, or in `brewless.yml` (below). **Follow the application** removes it again.
2. The application's choice: on the application's **Environments** tab, in the **Backups** card, under **Second copy**, tick the destinations its environments copy to. **Follow the organisation** removes the application's own choice again. Ticking none means no second copy for that application.
3. The organisation's default destinations on the Backups page.

A change applies from the next backup.

In `brewless.yml`:

```yaml
environments:
  production:
    backup:
      destinations: [primary, bunny-de]
```

## Testing a destination

**Test** in the console, or `brewless backup:destination:test <name>`, runs a check in your own account, from an environment whose backups are on, with the credentials in your Secret Manager. It writes, reads, lists and deletes a test object, and looks for versioning, Object Lock and multipart uploads. The result shows on the destination once the runner reports.

## How independent a destination is

The Backups tab says, per destination, what it protects against: encrypted, in another region, in another account or at another provider, and immutable when it has Object Lock.

> [!WARNING]
> A bunny.net Storage zone has one password for everything, so the job that writes backups there can also delete them. A Bunny destination is therefore never called immutable, whatever its other settings.

A secondary at another provider is the one level that also holds when Scaleway itself is gone. See [what the levels cover](/backups/getting-started#what-the-levels-cover).
