---
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 install during updates: it takes a backup before every update, restores
automatically if an update fails, and keeps a downloadable database backup afterwards. This page
explains what's backed up, where backups are stored, how to get them, and how to roll back.

## Backup before every update

Before **every** update, RelyPay takes a **full backup** — both its files and a snapshot of its
own database tables. This happens automatically as part of **Update Now** on
**Addons → RelyPay → Global Settings → Update Status**; you don't have to trigger it. See
[Updating](/relypay-whmcs/updating) for the full update flow.

## Automatic restore on failure

If an update fails partway through, RelyPay **automatically restores** both the files and the
database from the backup it just took, leaving your install exactly as it was before. There's
nothing for you to do — a failed update is a safe no-op.

::: 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 the file backup — the previous version's files are
always re-downloadable from your client area — and keeps a **database backup**. Recent backups are
listed under **Update Status → Database Backups**, each with a **Download** link.

![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
