---
url: /phonepe-whmcs/backup-and-restore.md
description: >-
  PhonePe for WHMCS has no built-in backup system, so back up your WHMCS
  database and module files before every update — and restore both to roll back.
---

# Backup and restore

PhonePe 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 before you change anything.

## Back up before every update

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

* **A WHMCS database backup** — this holds your gateway configuration (Client ID, webhook
  credentials, payment mode, License Key) along with your invoice and transaction records. Use
  WHMCS's automated backups (**Configuration → System Settings → General → Other**) or your host's
  tools (a `mysqldump` or cPanel/Plesk backup).
* **The gateway files you're about to overwrite:**
  * `modules/gateways/phonepe.php`
  * `modules/gateways/phonepe/` (the whole directory)
  * `modules/gateways/callback/phonepe.php`

::: tip Keep a copy off the server
Store at least one recent backup somewhere other than the WHMCS server itself, so a server problem
never takes your backups with it.
:::

## 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, and your file copies live wherever you save them — a dated folder
outside the web root, or a downloaded archive. Keep at least one copy **off the server**.

## Rolling back

To return to a previous working state after a bad update:

1. **Restore the module files** you copied back into `modules/gateways/`, overwriting the newer ones.
2. **Restore the WHMCS database backup** only if the update involved database changes.
3. Open **Setup → Payment Gateways → PhonePe**, confirm the settings, **Save Changes**, and run a
   test payment.

## Related pages

* [Updating](/phonepe-whmcs/updating) — the manual update flow that this protects
* [Uninstalling](/phonepe-whmcs/uninstalling) — removing the gateway entirely
* [Troubleshooting](/phonepe-whmcs/troubleshooting) — when a payment or webhook fails
