---
url: /relyai-acellemail/backup-and-restore.md
description: >-
  How RelyAI snapshots its own configuration before every update, where those
  snapshots are stored, why they must stay protected, and how to roll back.
---

# Backup and restore

RelyAI protects your setup automatically. Every time you run an in-place update it first takes a
snapshot of its own configuration, so a bad update can never lose your engines, keys or flags. This
page explains what's in a snapshot, where it lives, and how to roll back.

![Database snapshots on the Integrity & Updates tab](/relyai-acellemail/img/relyai-backup-snapshots.png)
*RelyAI → Settings → Integrity & Updates*

## Automatic snapshot before every update

Before applying any update, RelyAI snapshots **only its own configuration tables** — your settings,
your engines, your feature flags and the integrity baseline. It **never** touches AcelleMail's own
tables, and it **never** includes the AI request or usage history.

The snapshots appear on the Integrity & Updates tab under **Database snapshots**, listed by
**Version**, **Taken**, **Size** and a **Download** link. RelyAI keeps the **N most recent**
snapshots and prunes older ones automatically, so the folder never grows without bound.

## Where snapshots are stored

Both the configuration snapshot and the code backup live under **`storage/app/relyai-backups/`**.

::: danger These files hold secrets
A snapshot contains your **license key** and your **engine API keys**. RelyAI writes an Apache
`deny` rule into the backups folder to block web access. If you run **nginx** — which ignores
`.htaccess` — you must add an equivalent **server-level rule** yourself to deny access to that path.
:::

On a standard AcelleMail install, `storage/` sits **outside the web root**, so the folder isn't
web-reachable to begin with — but confirm this on your own server layout.

::: tip Keep your normal AcelleMail backups too
Because these snapshots deliberately exclude the AI request/usage history, they are **not** a full
backup of everything RelyAI stores. Keep your usual AcelleMail database backups so you can recover
conversation and audit history if you ever need it.
:::

## Rolling back

There are two ways back to a known-good state:

* **Automatic on a failed update.** If an update can't complete, RelyAI restores the previous
  version and its configuration for you — no action needed. See
  [Updating](/relyai-acellemail/updating).
* **Manual, from a snapshot.** Open the **Database snapshots** list and use **Download** to grab the
  snapshot you want, then restore it into your database with your usual tools.

## Related pages

* [Updating](/relyai-acellemail/updating) — where the pre-update snapshot is taken
* [File integrity](/relyai-acellemail/features/file-integrity) — the baseline that's snapshotted
* [Uninstalling](/relyai-acellemail/uninstalling) — what is and isn't kept when you remove RelyAI
* [Settings reference](/relyai-acellemail/settings) — the configuration that snapshots preserve
