Child pages
  • Guide to Transfer and Restore API Functions - Plan the Transfer Session

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

Excerpt

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.
Multiexcerpt
MultiExcerptNameTandRExcerpt


Note
titleNote:

In this example, the following statements are true:

  • remote.example.com and local.example.com represent the remote server and the local server.
  • 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 contains 123,456,789 bytes.
  • You want to transfer the package1 package from the remote server to the local server.
  • luggage12345 represents the root password for the remote server.


Retrieve the transfer modules

To retrieve a list of the transfer modules available on your server, run the WHM API 1 available_transfer_modules function.

Localtab Group


Localtab
activetrue
titleJSON API

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@880
MultiExcerptNameJSONAPI
PageWithExcerptWHM API 1 Functions - available_transfer_modules


Localtab
titlePHP


Code Block
languagetext
linenumberstrue
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:

Expand
titleClick to view...

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@880
MultiExcerptNameOutputJSON
PageWithExcerptWHM API 1 Functions - available_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 WHM API 1 transfer_module_schema function retrieves the following schemas:

Localtab Group


Localtab
activetrue
titleJSON API

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

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

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

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

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

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



Localtab
titlePHP

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

Expand
titleClick to view...


Code Block
languagetext
linenumberstrue
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 the PackageRemoteRoot module, add the following code to your PHP script :

Expand
titleClick to view...


Code Block
languagetext
linenumberstrue
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 the AccountRemoteRoot module, add the following code to your PHP script:

Expand
titleClick to view...


Code Block
languagetext
linenumberstrue
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:


Expand
titleClick to view...

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@880
MultiExcerptNameOutputJSON
PageWithExcerptWHM API 1 Functions - transfer_module_schema