# Backups in the console

Backups into another region of your own Scaleway account. How they stand, back up now, the defaults, destinations and your recovery key.


Brewless backs up an environment into a bucket in another region of your own Scaleway account: Paris is backed up to Amsterdam, every other region to Paris. The backups are made by a job that runs in that account, encrypted before they leave it. Nothing passes through Brewless, and Scaleway bills you directly for the storage and the few minutes the job runs.

## When your organisation gets backups

Backups by Brewless are rolled out in stages. Until they reach your organisation, the console has no Backups page. While they are in beta, the Backups page offers **Switch on the beta** to owners and admins: that gives the organisation backups, and switches nothing on yet. You then switch backups on per environment, as below. An organisation that already has backups set up keeps them, whatever the stage.

## Switching backups on

Backups by Brewless are **opt-in**: no environment is backed up until you switch backups on for it, production included. Switch them on per environment:

- in the console: open the environment, choose **Backups** and **Turn backups on**;
- or in `brewless.yml`, with `enabled: true` under the environment's `backup`:

```yaml brewless.yml
environments:
  production:
    backup:
      enabled: true
```

The environment's own choice always wins, on or off. The organisation cannot switch backups on; it only holds the defaults below that every environment you switch on gets.

## What a backup gets by default

- A backup every day at 03:30 (Europe/Amsterdam), and daily backups kept for 30 days, never fewer than three.
- The repository bucket has **Object Lock** in Governance mode: nobody can delete or change a backup before its lock ends, except an account admin who explicitly bypasses it.
- Your **secrets** are left out. Switch them on and they go into the backup encrypted; only that environment's runner may then read that environment's secret. See [Encryption and keys](/backups/encryption-and-keys#your-variables).

The organisation's defaults or the environment itself can choose otherwise; the narrowest choice wins.

## Who may delete a backup

Brewless makes three identities in your Scaleway account for every environment it backs up, each with a key that only your Secret Manager holds. They are the environment's own: the identities of your test environment cannot read production's backup key, its secrets or its backups, even when both live in one Scaleway project.

- **The runner** (`brewless-backup-runner-<project>-<environment>`) makes the backups. It may add to the backup bucket but not delete from it, apart from its own lock files. Someone who steals its key cannot remove a backup, also not on a bucket without Object Lock.
- **The prune identity** (`brewless-backup-prune-<project>-<environment>`) runs the daily maintenance: it forgets the backups past their retention, frees their space once a week and checks the repository. It is the only identity that may delete in the backup bucket, and its key is kept in a Secret Manager folder of its own (`/brewless-backup-prune/`) that the runner cannot read. The maintenance runs every day three hours after a daily backup starts, or at 05:15 for an hourly or custom schedule.
- **The restore identity** (`brewless-backup-restore-<project>-<environment>`) only reads the backups.

Environments set up before December 2026 shared one set of these per Scaleway project (`brewless-backup-runner-<project>` and so on). Their next provisioning gives them their own, with new keys in the same secrets, and then removes the old keys. Brewless removes a shared identity only once no environment uses it any more, and says so in the audit trail.

The state bucket, where Brewless puts the plan the jobs follow and the jobs put their reports, has a bucket policy of its own: only Brewless writes the plan, each environment's identities reach only that environment's part of it, and your application's own storage key cannot reach it.

## The Backups tab of an environment

Open an environment and choose **Backups** in the sidebar. The tab shows:

- **How well it is protected**: protected, partly protected (with the reasons, such as a backup that is overdue or a resource that cannot be backed up yet), setting up, or not protected by Brewless. An environment is never shown as protected before a first backup succeeded.
- **What these backups cover**: the scenario matrix below, with the level this environment reached and its Object Lock mode.
- **What is backed up**: every database and bucket of the environment, and the ones left out with the reason (the bucket for backups itself, a cache, a bucket another environment already backs up).
- **Destinations**: the primary bucket Brewless made and your own secondaries, each with how independent it is of the environment: encrypted, in another region or at another provider, and immutable when Object Lock is on.
- **Recovery points**: every successful backup, with its size, the new data and the release it backed up, **Restore checked** when a [restore test](/backups/restore-tests) loaded and checked it, and **Restore** to [restore from it](/running/restoring-backups).
- **Restores**: every restore of the environment and how it stands; **Open** picks one up where it was left.
- **Restore tests**: the monthly [restore test](/backups/restore-tests), **Test now**, and what every test checked.
- **Recovery Kit**: the download, and a notice when the kit changed since you last downloaded it.
- **History**: every run, how it was started, its outcome and how long it took.
- **The estimate**: about what the backups cost a month at Scaleway's list prices, including the hours of the [temporary Instance](/backups/files#large-buckets) for buckets too large for a backup job.

A recovery point can be **pinned**: it is then kept beyond retention, until you unpin it. The backup job in your account tags it, so the point counts as pinned once the job reports back. There is no button for it in the console yet; use the API:

| Endpoint | What it does |
| --- | --- |
| `POST /api/environments/{environment}/backups/points/{run}/pin` | Pin the recovery point |
| `DELETE /api/environments/{environment}/backups/points/{run}/pin` | Unpin it, so retention may remove it again; asks you to [confirm that it is you](#confirming-that-it-is-you) |

**Back up now** starts a backup outside the schedule. It runs in your account like any other; a second one while a backup is running is refused by the job itself.

**Object Lock** can be set per environment: Governance, Compliance (not even an account admin can delete a backup before its lock ends, and the lock cannot be shortened) or no lock. Choosing the organisation's mode again removes the environment's own choice.

**Turn backups off** stops the schedule: Brewless takes the schedules off the backup and maintenance jobs in your Scaleway account, and the audit trail says so (`backup.schedule_removed`). The jobs, the buckets, the keys and every backup made so far stay where they are; a backup stays in your bucket until its retention ends, and Brewless deletes nothing. Turning backups on again puts the schedules back (`backup.schedule_restored`).

Turning backups off and switching a lock mode first ask you to [confirm that it is you](#confirming-that-it-is-you).

> [!WARNING]
> A schedule more often than daily wakes a Serverless SQL Database for every backup. `brewless plan` says so before you change the schedule, and the Backups tab shows what it adds a month.

Before you switch backups on, the Backups tab shows what they would cost a month at Scaleway's list prices. Brewless never switches them on by itself and sends no mail announcing that it will.

## Switching an application on

An application's page has a **Backups** card on its **Environments** tab. **Switch on for production** switches backups on for the application's production environments, and sets them up in your account. A test environment stays off until you switch it on on its own Backups tab. An environment that chose for itself, on or off, keeps its choice. The card lists every environment, whether its backups are on, and why.

**Switch off** stops new backups of the production environments that were on because of the application. When that stops backups that run, it first asks you to [confirm that it is you](#confirming-that-it-is-you). Nothing that is already backed up is deleted.

The command line does the same:

```bash
brewless backup:switch on
brewless backup:switch off
```

The API is `GET` and `PATCH /api/applications/{application}/backups` with `enabled`.

### When an environment you switched on is set up by itself

In a later stage of the rollout, Brewless also sets up an environment whose backups you switched on (for instance with `enabled: true` in `brewless.yml`) but that is not set up yet, after its first release:

- An environment made from that stage on is set up straight away.
- An environment that already existed gets a notice first: its Backups tab shows a banner with the estimate and the day, 14 days ahead. On that day Brewless sets the backups up, unless you switched them off before then. **Not now** on the banner switches them off for that environment.

An environment you did not switch on is never touched. A setup that failed is not tried again by itself: the tab shows why, and switching backups on again tries once more.

## What the levels cover

| Level | Deleted by mistake | Corrupt app or database | Regional outage | Compromised app key | Compromised Scaleway account | Brewless gone | Provider gone |
| --- | --- | --- | --- | --- | --- | --- | --- |
| The provider's own backups only | yes | yes | partly | no | no | yes | no |
| + Brewless primary in another region | yes | yes | yes | yes | no | yes | no |
| + Object Lock Governance | yes | yes | yes | yes | partly | yes | no |
| + Object Lock Compliance | yes | yes | yes | yes | yes | yes | no |
| + secondary at another provider | yes | yes | yes | yes | yes | yes | yes |

These are technical levels, not plans you pay for.

## Organisation → Backups

**Backups** in the sidebar opens on its **Overview** tab: every application with its environments, how each one is protected, when its last backup succeeded and whether backups are on. **Switch on for production** backs up the application's production environments, as on the application's own page, and **Switch off** stops them; an environment that chose for itself keeps its choice. **Manage** opens an environment's Backups tab.

The **Defaults** tab holds the organisation's defaults:

- the schedule (daily at a time, or hourly at a minute past the hour);
- how many days daily backups are kept;
- the Object Lock mode;
- whether secrets are in the backup;
- the default destinations.

These are the settings an environment gets once you switch its backups on; switching on itself is done per environment. An empty field keeps Brewless's default, which the field names.

Where Brewless has them on, a **Webhooks** tab sends your backup events to endpoints of your own: see [Webhooks for backup events](/backups/webhooks).

Where Brewless has it on, a member of several organisations also gets an **Organisations** tab: see [Backups across your organisations](/backups/organisations).

In `brewless.yml`, an environment can also ask for [application-consistent backups](/backups/application-consistent), the [change feed for large buckets](/backups/change-feed) and, through the API, a [full key rotation](/backups/key-rotation), where Brewless has them on.

## Confirming that it is you

Some actions cannot be undone, or leave your backups weaker. Before them, Brewless asks you to confirm that it is you, on top of being signed in:

- turning backups off for an environment whose backups are set up, or for an application whose production backs up because of it;
- switching the Object Lock mode of an environment, or the organisation's default mode;
- [writing over the environment's own database](/running/restoring-backups#writing-over-the-current-database);
- unpinning a recovery point;
- [removing a destination](#removing-a-destination) of your own;
- [applying a restored configuration](/running/restoring-backups) whose `backup:` settings switch backups off or change the lock mode;
- making a new [recovery key](#the-recovery-key): it opens every backup of the environment, and confirming it removes the one you hold;
- [rotating the runner key](/backups/encryption-and-keys#rotating-the-runner-key);
- a [full key rotation](/backups/key-rotation), where Brewless has it on.

The console mails you a six-digit code and asks for it in a dialog. The code works for 10 minutes; once you entered it, these actions go ahead for the next 10 minutes, in that browser session only. Then the action you started is sent again. A session or a command line sign-in that fell into other hands is not enough without your mailbox as well.

The audit trail has an entry when you confirm (`security.reauthenticated`), and one for every action the confirmation let through (`security.reauthentication_passed`, naming the action). A wrong code is recorded as a failed sign-in; after five the code is dead and you request a new one. Brewless support, signed in to your organisation, cannot request a code.

The API answers such an action without a recent confirmation with `403` and `"code": "reauthentication_required"`. The same endpoints work for the command line client, bound to its own token:

| Endpoint | What it does |
| --- | --- |
| `POST /api/reauthentication` | Mail a new code; an earlier one stops working |
| `POST /api/reauthentication/confirm` | Enter the code: `code` |
| `GET /api/reauthentication` | Until when the last confirmation counts, or `null` |

## Destinations of your own

A secondary destination is a bucket of your own at bunny.net Storage, another Scaleway account or any S3 service, filled from the primary after every successful backup. They are on the **Destinations** tab, where **Add destination** asks for the endpoint, the region, the bucket, an optional prefix and a key, and **Test** checks one from your account. With bunny.net connected, **Create at bunny.net** makes a storage zone in your bunny.net account and adds it, asking only for a name. Which destinations an environment copies to you tick under **Second copy**: on the application's **Environments** tab, or on an environment's own **Backups** tab, which goes first. See [Destinations](/backups/destinations).

### Environments set up later

An environment whose backups are set up after the destination was added gets its key during the set-up. In a Scaleway project that holds the key already, because another environment there has it, Brewless uses that and reads nothing. Otherwise it copies the key from another environment whose backups are on, trying each until one works: Brewless reads the key from that environment's Secret Manager and writes it straight into the new one, in memory only, and the audit trail notes it (`backup.destination_key_copied`, naming both environments, never the key). When no environment has the key, or a Secret Manager refuses, the backups are set up all the same, and the destination says which environment lacks its key. **Enter key** there asks for the access key and secret key once more; they go straight to that environment's Secret Manager, as when you added the destination.

### Removing a destination

**Remove** on a destination asks you to [confirm that it is you](#confirming-that-it-is-you) first. Then no default names it any more, no environment backs up to it, and its key is deleted from the Secret Manager of every environment. What is already in the bucket stays there: Brewless deletes nothing in it, and you can still open it with restic and the recovery key. Empty the bucket yourself when you no longer need it. The audit trail has `backup.destination_removed`.

## The recovery key

With the recovery key you can restore without Brewless. Until it is stored, the Backups tab asks for it.

1. **Make the recovery key** first asks you to [confirm that it is you](#confirming-that-it-is-you), then has your browser make a key pair. The private half never leaves the page; only the public half goes to Brewless.
2. The job in your account makes the recovery key, adds it to every repository and sends it back encrypted with that public half, so only your browser can read it.
3. The key is shown once, with **Copy** and **Download as .txt**. Store it in a password manager or a safe, away from your Scaleway account.
4. Type the four characters the dialog asks for. Only then does Brewless hear that you stored it; it forgets the encrypted key, and a key you made before is removed from the repositories.

> [!WARNING]
> Brewless does not keep the recovery key. Lose both it and the key the job keeps in your account, and the backups cannot be read.

Only the member who asked for the key gets the encrypted key and confirms it; the first time it is shown is in the audit trail (`backup.recovery_key_shown`). A key that is never confirmed is no longer handed out after a day, and is taken out of the repositories again, so a key nobody stored never stays valid. Brewless support, signed in to your organisation, cannot make, fetch or confirm a recovery key, nor add a destination. Without a browser that can make the key pair, use `brewless backup:recovery-key` on the command line.
