---
url: /relypay-whmcs/backup-and-restore.md
description: >-
  How RelyPay backs up before every update, restores automatically on failure,
  retains downloadable database backups, and how to roll back a successful
  update.
---

# Backup & restore

RelyPay protects your installation during updates with automatic safeguards:

* **Pre-update backup:** Captures files and database tables before every update.
* **Automatic rollback:** Restores the previous state immediately if an update fails.
* **Retained database snapshot:** Keeps downloadable database backups after successful updates.

## Backup before every update

Before **every** update, RelyPay captures a **full backup** of its files and database tables:

* **Automatic execution:** Runs as part of **Update Now** on **Addons → RelyPay → Global Settings → Update Status**.
* **No manual intervention:** Triggers automatically before any file is replaced. See [Updating](/relypay-whmcs/updating) for details.

## Automatic restore on failure

If an update encounters an error, RelyPay **automatically restores** files and database tables from the pre-update backup:

* **Instant recovery:** Restores the installation to its exact prior state.
* **Safe failure:** Aborts cleanly without leaving half-applied files or broken schemas.

::: tip
Because the backup is taken first, a failed one-click update never leaves you with a half-applied
version.
:::

## Retained database backups

After a **successful** update, RelyPay removes temporary file backups and keeps a **database backup**:

* **Downloadable snapshots:** Listed under **Update Status → Database Backups** with direct **Download** links.
* **Client area archives:** Previous version files remain downloadable anytime from your client area.

![Database Backups panel](/relypay-whmcs/img/relypay-backup-and-restore-database-backups.png)
*Addons → RelyPay → Global Settings → Update Status → Database Backups*

::: danger Store these privately
A retained database backup includes your **configuration and license details**. Download it only
over a secure connection and **store it privately** — never in a publicly reachable location.
:::

## Where backups are stored

Backups live in `modules/addons/relypay_backups/` on your server.

* On **Apache**, web access to this directory is blocked automatically.
* On **nginx**, there's no per-directory rule, so ask your host to **deny web access** to
  `modules/addons/relypay_backups/`.

::: warning
The backups directory holds sensitive data. If you're on nginx, confirm with your host that
`modules/addons/relypay_backups/` is not web-accessible before relying on one-click updates.
:::

## Rolling back a successful update

There is **no one-click rollback of a successful update**. If you need to return to a previous
version, use the manual path:

1. Download the previous release ZIP from your client area.
2. Reinstall it over `modules/addons/relypay/`, following the
   [manual update steps](/relypay-whmcs/updating#manual-update).
3. If the database also needs restoring, [contact support](/start/support) for help — for anything
   more than files, involve support before restoring a database backup.

::: info
Rolling back is uncommon. If an update caused a problem, check
[Troubleshooting](/relypay-whmcs/troubleshooting) first — most issues are resolved by a re-sync or
a configuration fix rather than a full rollback.
:::

## Related pages

* [Updating](/relypay-whmcs/updating) — the one-click and manual update flows
* [Troubleshooting](/relypay-whmcs/troubleshooting) — resolving update issues
* [Licensing](/relypay-whmcs/licensing) — license details are part of a backup
