WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function backs up an account with the pkgacct script.
Note:
- The
/usr/local/cpanel/scripts/pkgacctscript logs results to the/var/cpanel/pkgacct_sessions/session_id/directory, wheresession_idrepresents the backup session's ID. - The target system streams the output of this function with the
/usr/local/cpanel/whostmgr/docroot/cgi/live_tail_log.cgiscript on the source system. Users should not directly call this script.
Whether to compress the data in .gzip format.
compress- Compress the data.null- Do not compress the data.
Whether to update the destination file with any new content since the previous backup. This parameter also removes any content that no longer exists on the account. If the destination file does not exist, the function creates a new file in that location.
1— Create an incremental archive file.0— Do not create an incremental archive file.
Note:
When you use this parameter, the system creates the backup as an uncompressed archive.
Whether to run the background task with a reduced priority.
1— Run the backup as a low priority task.0— Run the backup with normal priority.
The minimum version of MySQL® that the system requires to restore the backed up database files.
Note:
- You can view the server's installed version of MySQL in the
/var/cpanel/cpanel.configfile. - This parameter defaults to the current installed version of MySQL.
Whether to encode each line of the script's output in JSON format in order to allow the live_tail_log.cgi script to stream it.
1— Serialize the output.0— Do not serialize the output.
Whether to exclude the account's databases from the cpmove archive.
1— Do not back up the account's databases.0— Back up the account's databases.
Whether to exclude the account's API tokens from the archive.
1— Do not back up the account's API tokens.0— Back up the account's API tokens.
Whether to exclude the account's external authentication credentials from the archive.
1— Do not back up the account's external authentication credentials.0— Back up the account's external authentication credentials.
Whether to exclude the account's bandwidth data from the archive.
1— Do not back up the account's bandwidth data.0— Back up the account's data.
Whether to exclude the account's DNSSEC configuration from the archive.
1— Do not back up the account's DNSSEC configuration.0— Back up the account's DNSSEC configuration.
Whether to exclude the account's DNS zone file information from the archive.
1— Do not back up the account's DNS zone file information.0— Back up the account's DNS zone file information.
Whether to exclude the account's FTP user accounts from the archive.
1— Do not back up the account's FTP user accounts.0— Back up the account's FTP user accounts.
Whether to skip the home directory's contents.
1— Do not back up the account's home directory.0— Back up the account's home directory.
Whether to exclude the account's cPanel & WHM linked server nodes configuration from the archive.
1— Do not back up the account's linked server nodes configuration.0— Back up the account's linked server nodes configuration.
Whether to exclude the account's log files from the archive.
1— Do not back up the account's log files.0— Back up the account's log files.
Whether to exclude the account's reseller privileges from the archive.
1— Do not back up the account's reseller privileges.0— Back up the account's reseller privileges.
Whether to exclude the account's shell information and privileges from the archive.
1— Do not back up the account's shell information and privileges.0— Back up the account's shell information and privileges.
Whether to exclude the account's virtual host (vhost) templates from the archive.
1— Do not back up the account's vhost templates.0— Back up the account's vhost templates.
Whether to create the cpmove archive in chunks.
1— Create the archive in chunks.0— Create a single archive file.
The path to the directory in which you wish to store the cpmove archive.
Note:
This parameter defaults to /home/user, where user represents the username of the account.
Whether to use the account's last known successful backup as a template when the script creates the cpmove archive, if any exist.
1— Use the account's last known successful backup as a template, if any exist.0— Do not use the account's last known successful backup.
Note:
This parameter may reduce the amount of time that the backup process requires.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/start_background_pkgacct
- A server running WHM.
https://whm-server.tld:2087/json-api/start_background_pkgacct
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/start_background_pkgacct?user=username&compressionsetting=compress&incremental=1&low_priority=1&mysqlver=5.5&serialized_output=1&skipacctdb=1&skipapitokens=1&skipauthnlinks=1&skipbwdata=1&skipdnssec=1&skipdnszones=1&skipftpusers=1&skiphomedir=1&skiplinkednodes=1&skiplogs=1&skipresellerconfig=1&skipshell=1&skipvhosttemplates=1&split=1&tarroot=%2Fhome%2Fuser&use_backups=1'{ "data": { "complete_master_error_log": "master.error_log", "complete_master_log": "master.log", "session_id": "example20151109162046c4xzDp55q9u4tPj" }, "metadata": { "command": "start_background_pkgacct", "reason": "OK", "result": 1, "version": 1 } }
A filepath that contains the account's cpmove tarball or the directory path that contains the extracted cpmove tarball.
Note:
You can use the pkgacct script to create a cpmove tarball.
Whether to assign the account a dedicated IP address.
1- Assign a dedicated IP address.0- Do not assign a dedicated IP address.Note:
The system must have an available IP address.
Whether to delete the cpmove tarball or extracted directory, given in the cpmovepath parameter, after the system completes the account restoration.
1- Delete thecpmovetarball or extracted directory.0- Do not delete thecpmovetarball or extracted directory.
The server on which the account's email will reside after the system completes the transfer.
.local- Use the local server the account is being restored on..existing- Use the server location defined in the account's backup data. The system defaults to the.localparameter if this does not work.ALIAS- Use a cPanel & WHM linked node server's alias. For example, theexample-aliasfor theservernode.example.comdomain. The system defaults to the.localparameter if this does not work.
Whether to overwrite an existing account on the server, if one exists.
1- Overwrite an existing account.0- Do not overwrite an existing account on the server.
Whether to perform a restricted restore for the account. The system will perform security checks on the backup file. If you do not trust the source of the account backup with root access to your server, use this parameter to protect your server.
1- Perform a restricted restore.0- Do not perform a restricted restore.
Important:
- This parameter is experimental. Do not consider it as an effective security control. For more information, read our restricted restore documentation.
- If the account owns PostgreSQL® databases, your server must use PostgreSQL version 8.4 or newer.
- This parameter only allows restored accounts to use the
noshellorjailshellenvironments. If the account uses a different shell, the system will set the account to use thenoshellenvironment. - If there is an issue with the backup file, the system will not restore that part of the backup file. It will also adds a warning to the log file.
Whether to perform one of the following actions to the account's A records:
all- Replace all instances of the original server's IP address with the new server's IP address.basic- Only replace the cPanel provided A records.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/start_local_cpmove_restore
- A server running WHM.
https://whm-server.tld:2087/json-api/start_local_cpmove_restore
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/start_local_cpmove_restore?cpmovepath=%2Fhome%2Fcpmove-newacct.tar.gz&dedicated_ip=0&delete_archive=0&mail_location=.existing&overwrite=1&restricted=0&update_a_records=all&username=example'{ "data": { "transfer_session_id": "example202003301756425ugO" }, "metadata": { "command": "start_local_cpmove_restore", "reason": "OK", "result": 1, "version": 1 } }