Moving Databases to Another Subscription

Use the assign-to-subscription operation to move a database to another subscription. Learn more in the Administrator's Guide.

Next in this section:

Request Packet Structure

Response Packet Structure

Samples

 
Request Packet Structure

A request XML packet moving a database between subscriptions includes the assign-to-subscription operation node:

<packet>
<database>
   <assign-to-subscription>
   ...
   </assign-to-subscription>
</database>
</packet>

 

The assign-to-subscription node is presented by type DatabaseAssignToSubscriptionInputType (database_input.xsd), and its graphical representation is as follows:

assign-to-subscription

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

  • The filter node is required. It specifies the filtering rule. For information on filters, refer to the Available Filters section. Data type: DatabaseFilterType.
  • The webspce-id node is required. It specifies the subscription to which the database will be moved. Data type: id_type.
 
Response Packet Structure

The assign-to-subscription node of the output XML packet is presented by type DatabaseSetDBOutputType (database_output.xsd) and structured as follows:

assign-to-subscription_output

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.

  • The result node is required. It wraps the response retrieved from the server. Data type: resultType (common.xsd).
  • The status node is required. It specifies the execution status of the set-default-user operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Is returns the error code if the set-default-user operation fails. Data type: integer.
  • The errtext node is optional. It returns the error message if the set-default-user operation fails. Data type: string.
  • The filter-id or id node is optional. It returns the parameter of a filtering rule. Learn more in Available Filters.
 
Samples

This request moves the database with ID 1 to the subscription with ID 2.

<packet>
  <database>
    <assign-to-subscription>
      <filter>
        <id>1</id>
      </filter>
      <webspace-id>2</webspace-id>
    </assign-to-subscription>
  </database>
</packet>

Response:

<packet version="1.6.7.0">
  <database>
    <assign-to-subscription>
      <result>
        <status>ok</status>
        <filter-id>1</filter-id>
        <id>1</id>
      </result>
    </assign-to-subscription>
  </database>
</packet>