---
url: /payglocal-recurring-whmcs/backup-and-restore.md
description: >-
  PayGlocal Recurring has no built-in backups — use standard WHMCS database
  backups plus copies of your RSA .pem keys. What to save before updating, where
  it lives, and how to roll back.
---

# Backup and restore

PayGlocal Recurring is a WHMCS payment gateway with **no built-in backup system** — no automatic
pre-update snapshot and no one-click restore. You protect it with **standard WHMCS practice**: back
up your database, and copy the gateway files and your RSA `.pem` keys before you change anything.
Because this gateway stores recurring **mandates**, a good backup is what lets you roll back cleanly.

## Back up before every update

Because a [manual update](/payglocal-recurring-whmcs/updating) overwrites files directly, always take
a backup first. Capture:

* **A WHMCS database backup** — this holds your gateway configuration (License Key, Merchant ID, key
  paths, KIDs, and the SI limits) and your customers' **stored mandates**, along with your invoice
  and transaction records. Use your normal WHMCS or host backup routine.
* **The gateway files you're about to overwrite:**
  * `modules/gateways/payglocalrecurring.php`
  * `modules/gateways/payglocalrecurring/` (the whole directory)
  * `modules/gateways/callback/payglocalrecurring.php`
  * `includes/hooks/payglocalrecurring_cron.php`
* **A copy of your RSA `.pem` keys** — the merchant private key and the PayGlocal public key, with a
  note of their paths and KIDs.

::: warning Guard your RSA keys
Your existing mandates were authorised against your current RSA keys. Keep safe copies and don't
casually regenerate them, or those mandates can no longer be charged.
:::

## Where backups are stored

There is no backup folder created by the gateway. Your database backup lives wherever your WHMCS or
host backup process puts it; keep at least one copy **off the server**. Store your `.pem` key copies
somewhere secure **outside the web root**, mirroring how the live keys are stored (`chmod 640`,
readable by the web-server user).

## Rolling back

To return to a previous working state after a bad update or server change:

1. **Restore the module files** — re-upload the previous release into `modules/` and `includes/`,
   overwriting the newer files.
2. **Leave your RSA keys as they were** — do not regenerate them, since your mandates were authorised
   against the original keys. Restore them from your copy only if they were moved or lost.
3. **Restore the WHMCS database backup** only if your settings or mandates changed.
4. Open **Setup → Payment Gateways → PayGlocal Recurring**, confirm the fields, **Save Changes**, and
   take a sandbox test payment to confirm the flow works again.

## Related pages

* [Updating](/payglocal-recurring-whmcs/updating) — back up first, then overwrite files
* [Licensing](/payglocal-recurring-whmcs/licensing) — your license key is part of the saved settings
* [Uninstalling](/payglocal-recurring-whmcs/uninstalling) — what's removed and what's kept
* [Troubleshooting](/payglocal-recurring-whmcs/troubleshooting) — fixing key and mandate issues
