Child pages
  • WHM API 1 Functions - convert_addon_initiate_conversion
Skip to end of metadata
Go to start of metadata

Description

This function initiates the conversion process for an addon domain into a cPanel account.

Note:

For information about the data that the system migrates when you convert an addon domain, read our Addon Domain Conversion List documentation.

Important:

In cPanel & WHM version 76 and later, when you disable the WebServer role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/convert_addon_initiate_conversion?api.version=1&domain=example.com&username=username&copymysqldb-olddatabase=newdatabase&movemysqldb=exampledb2&movemysqluser=dbuser
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/convert_addon_initiate_conversion?api.version=1&domain=example.com&username=username&copymysqldb-olddatabase=newdatabase&movemysqldb=exampledb2&movemysqluser=dbuser
 Command Line
whmapi1 convert_addon_initiate_conversion domain=example.com user=username copymysqldb-olddatabase=newdatabase movemysqldb=exampledb2 movemysqluser=dbuser


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
   "metadata" : {
      "version" : 1,
      "reason" : "OK",
      "result" : 1,
      "command" : "convert_addon_initiate_conversion"
   },
   "data" : {}
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <result>1</result>
        <command>convert_addon_initiate_conversion</command>
        <reason>OK</reason>
    </metadata>
    <data></data>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
usernamestring

Required

The username for a specified account.

A valid cPanel user account.username
domainstring

Required

The addon domain to convert into an account's main domain.

A valid addon domain.example.com
pkgnamestring

The hosting package that you want to assign to the new account.

This value defaults to default.

A valid package name.default
copymysqldbstring

Copy a MySQL database from the source account to the new account with a new database name.

Note:

To copy multiple databases, call this parameter with the copymysqldb-olddatabase=newdatabase format. For example, to copy two separate databases, use the copymysqldb-olddatabase1=newdatabase1 copymysqldb-olddatabase2=newdatabase2 format.

If you do not specify this parameter, the system does not copy any MySQL databases to the new account.

A valid MySQL database.
olddatabase=newdatabase
movemysqldbstring

Move the specified MySQL database from the source account to the new account.

Note:

To move multiple databases, use the movemysqldb-# format, where # represents an increment value. For example, to move two databases, you would use the movemysqldb-1 and movemysqldb-2 format.

If you do not specify this parameter, the system does not move any MySQL databases to the new account.

A valid MySQL database.exampledb2
movemysqluserstring

Move the specified MySQL database user from the source account into the new MySQL database account.

Note:

To move multiple database users, use the movemysqluser-# format, where # represents an increment value. For example, to move two database users, you would use the movemysqluser-1=dbuser1 movemysqluser-2=dbuser2 format.

If you do not specify this parameter, the system does not move any MySQL database users to the new account.

A valid MySQL database username.dbuser

Returns

This function only returns metadata.