---
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 automatically snapshots its configuration before every in-place update. If an update fails, your engines, API keys, and feature flags remain safe.

![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 updates, RelyAI snapshots only its own configuration tables:

* **Included:** Settings, engine configurations, API keys, feature flags, and integrity baseline.
* **Excluded:** AcelleMail core database tables and AI request/usage history.

Snapshots display under **Database snapshots** on the Integrity & Updates tab with **Version**, **Taken**, **Size**, and a **Download** link.

* **Retention:** RelyAI keeps the **three most recent** snapshots.
* **Auto-pruning:** Older snapshots are purged automatically.

## Where snapshots are stored

Both configuration snapshots and code backups live in **`storage/app/relyai-backups/`**.

::: danger Protect snapshot files
Snapshots contain your **license key** and **engine API keys**.

* **Apache:** RelyAI creates a `deny` rule in the backups directory automatically.
* **Nginx:** Add a server-level block rule for `storage/app/relyai-backups/` since Nginx ignores `.htaccess`.
  :::

On standard AcelleMail installs, `storage/` resides outside the web root. Confirm this layout on your server.

::: tip Maintain standard AcelleMail backups
RelyAI snapshots exclude AI request and usage history. Continue running standard database backups to preserve complete conversation and audit records.
:::

## Rolling back

Choose from two rollback methods:

* **Automatic on failed update:** If an update fails, RelyAI restores the previous version and configuration automatically. See [Updating](/relyai-acellemail/updating).
* **Manual from snapshot:** Download a snapshot from **Database snapshots** and import it into your database.

## Related pages

* [Updating](/relyai-acellemail/updating) — Pre-update snapshot and rollback workflow
* [File integrity](/relyai-acellemail/features/file-integrity) — Baseline verification and auto-sync
* [Uninstalling](/relyai-acellemail/uninstalling) — Data retention and complete removal
* [Settings reference](/relyai-acellemail/settings) — Configuration fields preserved by snapshots
