cPanel WHM icon

cPanel WHM

Full cPanel WHM API — all 622 operations across Accounts, DNS, Mail, SSL, Backups, Databases and more

Actions262

Backup → Restore account backup

AI-generated

Summary

Restore a user's cPanel account from the most recent backup of a specified type (monthly, weekly, or daily), with options to create the account before restoring and selectively restore components.

Inputs

  • Type (required) — Specify which backup type to restore from: monthly, weekly, or daily. The operation restores the most recent backup of the selected type.
  • User (required) — Provide the username of the account to restore.
  • All — Decide whether to create the account before restoration (1) or restore only to an existing account (0). Creating an account that already exists will cause failure.
  • Ip — Choose whether to assign a dedicated IP address (1) or use the shared IP address (0) during the restoration.
  • Mail — Select whether to restore account-level mail filters and forwarders (1) or not (0).
  • Mysql — Indicate whether to restore the account's MySQL® databases (1) or skip restoring databases (0).
  • Subs — Specify if subdomains should be restored (1) or not (0).

Output shape

a single JSON object representing the response from the WHM API regarding the restore operation, including success or error details.

The response may include error information if the restore fails (e.g., account exists when 'All' is set to create). No pagination or multiple item lists are returned.

Examples

Example 1: Restore the most recent weekly backup for user 'johndoe', restoring mail and MySQL databases but not assigning a dedicated IP.

Type: weekly; User: johndoe; Mail: 1; Mysql: 1; Ip: 0; All: 0

Example 2: Create and restore a new account from the latest monthly backup with all components restored, including subdomains and a dedicated IP.

Type: monthly; User: newuser; All: 1; Mail: 1; Mysql: 1; Subs: 1; Ip: 1

Links

Discussion