Update configuration file from backup

This function restores a configuration backup from a file. If the backup file does not contain any changes, the system does not write to the configuration file.

SecurityBasicAuth
Request
query Parameters
module
required
string

The configuration module's name.

Important:

This parameter is case-sensitive. You must enter the parameter in the correct case format; otherwise, the function will fail.

Example: module=Main
path
required
string

The absolute path to configuration file.

Note: If this parameter contains JSON or equals-sign key and value pairs, they must appear in new lines.

Example: path=/var/cpanel/cpanel.config
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
get/restore_config_from_file
Request samples
whmapi1 --output=jsonpretty \
  restore_config_from_file \
  module='Main' \
  path='/var/cpanel/cpanel.config'
Response samples
application/json
{
  • "metadata": {
    • "command": "restore_config_from_file",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}