# HA backup and recovery

> Where backups are kept in an HA deployment, how to keep a copy outside the cluster, and how to recover.

An [HA deployment](/docs/buttons/v1.10/installation/high-availability) keeps running when one of its three machines fails, because every part of Buttons, including the database, runs on all three. That protects you against losing a machine. It doesn't protect you against a bad change, an accidental deletion or losing the whole cluster: a mistake is copied to all three machines just as quickly as everything else. For those cases you need a backup.

This page covers only what's different in an HA deployment. Backups themselves work the same way as on a single machine: see [Configure and monitor scheduled backups](/docs/buttons/v1.10/administration/scheduled-backups), [Restore a backup and verify it](/docs/buttons/v1.10/administration/restore-and-verify) and [Export or import Buttons configuration](/docs/buttons/v1.10/administration/configuration-import-export).

## Where backups are kept

Scheduled and manual backups are stored on storage that is copied to all three machines. A backup therefore survives losing any one machine, and you can restore it from **Settings** as usual.

The backups are still kept inside the cluster, though. If you lose all three machines, or their storage, the backups are lost with them.

## Keep a copy outside the cluster

To be able to recover from losing the whole cluster, keep a recent copy of your configuration somewhere else:

1. Export the configuration from **Settings → Configuration data**, as described in [Export configuration](/docs/buttons/v1.10/administration/configuration-import-export#export-configuration).
2. Store the downloaded archive outside the cluster, for example on a file server or in your organization's backup system.
3. Repeat this regularly, and after any large change.

<callout color="gray" title="Note">
  A future version of Buttons will be able to copy backups automatically to S3 or Azure Blob Storage. Until then, exporting the configuration is how you get a copy out of the cluster.
</callout>

## Recover

What to do depends on what you've lost:

| What happened | What to do |
| --- | --- |
| One machine failed. | Nothing needs restoring. Buttons keeps running on the other two machines. Bring the failed machine back as soon as you can, because the cluster can't survive losing a second one. |
| A change or deletion went wrong. | Restore a backup from before the change, as described in [Restore a backup and verify it](/docs/buttons/v1.10/administration/restore-and-verify). |
| The whole cluster or its storage is lost. | Contact Bitfocus to reinstall the cluster, then import your most recent exported archive, as described in [Import configuration](/docs/buttons/v1.10/administration/configuration-import-export#import-configuration). |

A restore replaces the current configuration. Everyone connected is disconnected while it runs, and anything changed after the backup or export was made is lost.

After a restore, give Buttons a moment to start all its services again on all three machines. Check that the **System Health** banner is back to OK before you rely on the result. See [Interpret system health and restart services safely](/docs/buttons/v1.10/administration/services-and-health).

## Where to go next

- [Deploy Buttons with High Availability](/docs/buttons/v1.10/installation/high-availability)
- [Configure and monitor scheduled backups](/docs/buttons/v1.10/administration/scheduled-backups)
- [Restore a backup and verify it](/docs/buttons/v1.10/administration/restore-and-verify)
- [Export or import Buttons configuration](/docs/buttons/v1.10/administration/configuration-import-export)
- [Interpret system health and restart services safely](/docs/buttons/v1.10/administration/services-and-health)
