Add module to transfer session

This function adds a transfer session to a queue. For more information about how this function works with other functions in the transfer and restore process, read our Guide to Transfer and Restore API Functions documentation.

Important:

The module parameter determines which additional parameters to use with the function.

SecurityBasicAuth
Request
Request Body schema: application/x-www-form-urlencoded

An enqueue transfer item.

module
required
string

The transfer system module.

  • LegacyAccountBackup — This module restores legacy-account backup files.
  • FeatureListRemoteRoot — This module transfers the feature list from the remote server.
  • PackageRemoteRoot — This module transfers the package settings.
  • AccountLocal — This module restores backup files.
  • AccountRemoteRoot — This module uses the root credentials to transfer account settings that are not a part of a package.
  • AccountRemoteUser — This module uses the account's user credentials to transfer account settings that are not a part of a package.

Note:

  • The module parameter determines which additional parameters to use with the function.
  • You must perform each module action as a separate step.

When you call this function, you must include the additional parameters for the desired transfer system module. Select a module from the menu to view its required additional parameters:

size
integer >= 1
Default: 1

The size of the content to transfer, in bytes. The restore system uses this value to determine the best filesystem partition for the restored account’s home directory. For best results, give as accurate of a value as possible.

transfer_session_id
required
string

The transfer session's ID.

customip
string

The custom IP address to assign to the transferred account.

Note:

This parameter requires that the ip parameter has a value of 1.

detected_remote_user
string

The user account name that the remote server returns when you query the user account.

domain
string <domain>

The domain name.

ip
integer

Whether to assign a dedicated IP address to the transferred account.

  • 1 — Assign a dedicated IP address.
  • 0 — Do not assign a dedicated IP address.

Note:

If no dedicated IP address exists, the system assigns the account to a shared IP address.

Enum: 0 1
localuser
required
string <username>

The local account's username.

string or string
Default: ".existing"

The server on which the account's email will reside after it completes the transfer.

  • .local — The local server.
  • .existing — Use the location defined in the account's backup data.
  • The alias (friendly name) of a remote cPanel & WHM linked server node.. For example, the example-alias for the servernode.example.com domain.

Note:

The system will use the .local option if:

  • The system cannot use the cPanel & WHM linked server node when you call the .existing option.
  • The cPanel & WHM linked server node's alias (friendly name) is invalid.
overwrite_sameowner_dbs
integer

Whether to allow the system to overwrite the account's existing databases with the databases in the backup file.

  • 1 — Overwrite.
  • 0 — Do not overwrite.
Enum: 0 1
overwrite_sameowner_dbusers
integer

Whether to allow the system to overwrite the account's existing database users with the database users in the backup file.

  • 1 — Overwrite.
  • 0 — Do not overwrite.
Enum: 0 1
overwrite_with_delete
integer

Whether to replace and delete all directories and files on the destination server.

  • 1 — Overwrite.
  • 0 — Do not overwrite.

Warning:

If you use this parameter, the system deletes every directory and file on the destination server. The system does not delete the directories and files from the source server.

Enum: 0 1
replaceip
string

The lines in the domain's zonefile to replace with the new IP address.

  • all — Replace all of the matching A record addresses in the zone file with the new IP address, including custom A records.
  • basic — Replace only the cPanel-managed A records for this IP address. This includes the main domain and any service subdomains.
Enum: "all" "basic"
reseller
integer

Whether to make the account a reseller.

  • 1 — Make the account a reseller account.
  • 0 — Do not make the account a reseller account.
Enum: 0 1
shared_mysql_server
integer

Whether one of the following conditions is true:

  • The target and remote servers share the same remote MySQL server.
  • The target server is the remote MySQL server for the remote server.
  • The remote server is the remote MySQL server for the target server.

Value:

  • 1 — One is true.
  • 0 — None are true.
Enum: 0 1
skipaccount
integer

Whether to skip the recreation of the account.

  • 1 — Skip.
  • 0 — Restore.

Note:

  • The values you enter for the user and localuser parameters must match.
  • This parameter is similar to the force parameter, but performs none of the account creation steps.
Enum: 0 1
skipacctdb
integer

Whether to skip the transfer of the account's databases.

  • 1 — Skip.
  • 0 — Restore.
Enum: 0 1
skipbwdata
integer

Whether to skip the transfer of the account's bandwidth data.

  • 1 — Skip.
  • 0 — Restore.
Enum: 0 1
skiphomedir
integer

Whether to skip the contents of the home directory.

  • 1 — Skip.
  • 0 — Restore.
Enum: 0 1
skipres
integer

Whether to skip restoration of the account's reseller permissions.

  • 1 — Skip.
  • 0 — Restore.
Enum: 0 1
user
required
string <username>

The account to transfer.

force
integer

Whether to overwrite an account with an identical username.

  • 1 — Overwrite the account.
  • 0 — Do not overwrite the account.

This parameter performs the following actions:

  • Restores the cPanel account on the destination server.
  • Overwrites all account settings, data, and databases.
  • Ignores errors and warnings for naming conflicts.

Note:

  • The values you enter for the user and localuser parameters must match.
  • You cannot use this parameter if you called the WHM API 1 create_remote_root_transfer_session function with the unrestricted_restore parameter set to 1.
Enum: 0 1
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
get/enqueue_transfer_item
Request samples
application/x-www-form-urlencoded
module=AccountLocal&size=133698&transfer_session_id=vm5docscpanelcopya20140211211719FxjU&customip=192.168.0.1&detected_remote_user=user&domain=example.com&ip=1&localuser=localuser&mail_location=.local&overwrite_sameowner_dbs=1&overwrite_sameowner_dbusers=1&overwrite_with_delete=1&replaceip=all&reseller=1&shared_mysql_server=1&skipaccount=1&skipacctdb=1&skipbwdata=1&skiphomedir=1&skipres=1&user=user&force=1
Response samples
application/json
{
  • "metadata": {
    • "command": "enqueue_transfer_item",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}