---
url: /payglocal-whmcs/backup-and-restore.md
description: >-
  How to back up PayGlocal for WHMCS — there is no built-in backup system, so
  use standard WHMCS database backups plus a copy of your RSA .pem keys.
---

# Backup and restore

PayGlocal for WHMCS 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.

## Back up before every update

Because a [manual update](/payglocal-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 mode) 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/payglocal.php`
  * `modules/gateways/payglocal/` (the whole directory)
  * `modules/gateways/callback/payglocal.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 Don't casually regenerate your RSA keys
Your merchant private key and its KID are tied to your PayGlocal account. Regenerating keys in the
GCC dashboard invalidates the old pair — only do it deliberately, and update the gateway settings to
match. A backup copy means you never lose a working key.
:::

## 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/`, overwriting the
   newer files.
2. **Restore your `.pem` keys** to their original paths if they were moved or lost.
3. **Restore the WHMCS database backup** only if the configuration changed.
4. Open **Setup → Payment Gateways → PayGlocal**, confirm the fields, **Save Changes**, and take a
   sandbox test payment to confirm the flow works again.

## Related pages

* [Updating](/payglocal-whmcs/updating) — back up first, then overwrite files
* [Configuration](/payglocal-whmcs/configuration) — the settings held in the database
* [PayGlocal key setup](/payglocal-whmcs/guides/payglocal-keys) — where the `.pem` keys come from
* [Troubleshooting](/payglocal-whmcs/troubleshooting)
