WebsiteBackup
Start an in-place restore of a website backup
Changed onThis function starts an in-place restore of the domain parameter from the named backup and returns an operationId return value immediately.
Note:
- The work runs in a detached background process. Poll the WebsiteBackup::operation_status function with the returned id for progress and the terminal state, or recover the id from the WebsiteBackup::list_operations function after a page reload.
- By default the function restores the document root as a merge. The archive's files overwrite their counterparts, missing files are added, and files created since the backup are kept. The clean parameter selects a snapshot restore instead.
- Database restoration is opt-out, controlled by the restore_databases parameter, and the database parameter names the subset to restore.
- The function resets a restored database to exactly its backed-up state, dropping its existing objects and re-importing the dump, so objects created after the backup do not survive. It takes a rollback snapshot first, so a failed restore returns the database to its previous contents and reports failure rather than destroying live data.
- Pre-flight checks run synchronously and fail this call. The account must own the domain, the archive must exist, each named database must be recorded in the archive's manifest, no other backup or restore may be running for the account, and the expanded archive must fit on disk.
- The operation runs under a six-hour wall-clock cap.
- This function requires the account's backup feature and is unavailable to demo (shared) accounts.
post/WebsiteBackup/restore_backup
Request
- Base URLhttps://cpanel-server.tld:2083/execute
- AuthHTTP basic
Request body application/x-www-form-urlencoded
Example request
{
"clean": 1,
"database": [
"user_wordpress",
"user_store"
],
"domain": "example.com",
"id": "example.com-2026.08.18_12-53-12"
}Response
HTTP Request was successful.
Example response
{
"apiversion": 3,
"func": "restore_backup",
"module": "WebsiteBackup",
"result": {
"data": {
"operationId": "2026-08-18T12:53:12Z.1"
},
"status": 1
}
}Changes
- info
endpoint added
- info