v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
File Restoration

Restore databases

This function restores a database's backup files.

Important:

When the MySQL Client role is disabled, the system also disables this function.

Note:

You must pass either the file or backup parameter.

post/Backup/restore_databases

Query parameters

backupstring

The database backup file to restore.

Important:

Only pass this parameter to restore files already on the server.

Note:

To restore multiple database backup files, increment the parameter name. For example: backup-1, backup-2, and backup-3.

timeoutinteger
Example:3600

The maximum number of seconds to try to restore the file.

  • 0 - The system will not time out the file restoration.
verbose0 | 1
Example:1

Whether to return additional information from the /usr/local/cpanel/logs/cpbackup log file.

  • 1 - Return additional information.
  • 0 - Do not return additional information.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "restore_databases",
  "module": "Backup",
  "result": {
    "data": {
      "log_id": "2019-08-13T15:10:07Z.1",
      "log_path": "/home/cptest/logs/restoredb/2019-08-13T15:10:07Z.1.log",
      "messages": [
        "The system successfully restored the database 'user_db1' from the backup file 'user_db1.sql.gz'"
      ]
    },
    "status": 1
  }
}