<< Back - Introduction


Next - Create the Transfer Session >>





Overview

If you already know the modules that you need and the schema of each module, you can skip this step.

The planning process sets up the transfer session.

  • For root sessions, retrieve the transfer modules and schema.
  • For user transfer sessions, use the AccountRemoteUser user-based transfer session .

In these examples, the following statements are true:

  • You have two servers: remote.example.com and hostname.example.com
  • You logged in to the local server with the cpsess########## security token.
  • The example account owns example.com, and you want to transfer it from the remote server to the local server.
  • The example.com domain is 123,456,789 bytes.
  • You want to transfer the package1 package from the remote server to the local server.
  • The root password for the remote server is luggage12345  

Retrieve the transfer modules

To retrieve a list of the transfer modules available on your server, run the available_transfer_modules function as in the following examples:




include_once '../xmlapi.php';

$ip = getenv('REMOTE_HOST');
$root_user = getenv('REMOTE_USER');
$root_pass = getenv('REMOTE_PASSWORD');

$xmlapi = new xmlapi($ip , $root_user , $root_pass);
$xmlapi->set_output('json');

$settings = array('api.version'=>1);
$_result = $xmlapi->xmlapi_query('available_transfer_modules' , $settings);

print $_result;




This example will return the following list of transfer modules:

You can preserve features and modules between transfers. Use the following features to transfer features, module lists, and accounts:

  • FeatureListRemoteRoot — Transfers the feature lists.
  • PackageRemoteRoot — Transfers packages.
  • AccountRemoteRoot — Transfers the accounts.

The schema of each transfer module formats the data for transfer.

Retrieve the schema

The transfer_module_schema function retrieves the following schemas:


To retrieve the schema for FeatureListRemoteRoot, run the following browser-based call:

https://hostname.example.com:2087/cpsess##########/json-api/transfer_module_schema?api.version=1&module=FeatureListsRemoteRoot

To retrieve the schema for PackageRemoteRoot, run the following browser-based call:

https://hostname.example.com:2087/cpsess##########/json-api/transfer_module_schema?api.version=1&module=PackageRemoteRoot

To retrieve the schema for AccountRemoteRoot, run the following browser-based call:

https://hostname.example.com:2087/cpsess##########/json-api/transfer_module_schema?api.version=1&module=AccountRemoteRoot



To retrieve the schema for FeatureListRemoteRoot, add the following code to your PHP script :


include_once '../xmlapi.php';

$ip = getenv('REMOTE_HOST');
$root_user = getenv('REMOTE_USER');
$root_pass = getenv('REMOTE_PASSWORD');

$xmlapi = new xmlapi($ip , $root_user , $root_pass);
$xmlapi->set_output('json');

$settings = array('api.version'=>1, 'module' => 'FeatureListRemoteRoot');
$_result = $xmlapi->xmlapi_query('transfer_module_schema' , $settings);

print $_result;


To retrieve the schema for PackageRemoteRoot, add the following code to your PHP script :


include_once '../xmlapi.php';

$ip = getenv('REMOTE_HOST');
$root_user = getenv('REMOTE_USER');
$root_pass = getenv('REMOTE_PASSWORD');

$xmlapi = new xmlapi($ip , $root_user , $root_pass);
$xmlapi->set_output('json');

$settings = array('api.version'=>1, 'module' => 'PackageRemoteRoot');
$_result = $xmlapi->xmlapi_query('transfer_module_schema' , $settings);

print $_result;


To retrieve the schema for AccountRemoteRoot, add the following code to your PHP script:


include_once '../xmlapi.php';

$ip = getenv('REMOTE_HOST');
$root_user = getenv('REMOTE_USER');
$root_pass = getenv('REMOTE_PASSWORD');

$xmlapi = new xmlapi($ip , $root_user , $root_pass);
$xmlapi->set_output('json');

$settings = array('api.version'=>1, 'module' => 'AccountRemoteRoot');
$_result = $xmlapi->xmlapi_query('transfer_module_schema' , $settings);

print $_result;




The schema will resemble the following example:





Additional documentation