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.

Authorizations:
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.

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
Enum: 0 1

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.

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
Enum: 0 1

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.
overwrite_sameowner_dbusers
integer
Enum: 0 1

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.
overwrite_with_delete
integer
Enum: 0 1

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.

replaceip
string
Enum: "all" "basic"

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.
reseller
integer
Enum: 0 1

Whether to make the account a reseller.

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

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.
skipaccount
integer
Enum: 0 1

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.
skipacctdb
integer
Enum: 0 1

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

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

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

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

Whether to skip the contents of the home directory.

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

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

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

The account to transfer.

force
integer
Enum: 0 1

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.

Responses

Response Schema: application/json
object

Request samples

whmapi1 --input=json --output=json enqueue_transfer_item

Response samples

Content type
application/json
{
  • "metadata": {
    • "command": "enqueue_transfer_item",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}