<< Back - Plan the Transfer Session


Next - Check the transfer session >>





Overview

The creation process creates the transfer session.

Create the transfer session

To create the transfer session, use one of the following functions:


This function generates the following transfer session ID in the  transfer_session_id  return value:

In this example,  vm5docscpanelnoroo201402251939519hmy is the transfer session ID.



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_debug(1);
$xmlapi->set_output('json');

$settings = array(
    'api.version'=>1, 
    'remote_server_type' => 'cpanel', 
    'host' => 'remote.example.com', 
    'port' => '22', 
    'user' => 'root', 
    'password' => 'luggage12345', 
    'transfer_threads' => '1', 
    'restore_threads' => '1', 
    'enable_custom_pkgacct' => '1', 
    'unrestricted_restore' => '1', 
    'copy_reseller_privs' => '0', 
    'compressed' => '0', 
    'unencrypted' => '0', 
    'low_priority' => '0'
);

$_result = $xmlapi->xmlapi_query('create_remote_root_transfer_session' , $settings);

print $_result;

This function returns the following transfer session ID as the  transfer_session_id value:

In this example, vm5docscpanelnoroo201402251939519hmy is the transfer session ID.


This function returns the following transfer session ID in the  transfer_session_id value:

The transfer session ID is vm5docscpanelnoroo201402251939519hmy.



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_debug(1);
$xmlapi->set_output('json');

$settings = array(
    'api.version'=>1, 
    'host' => 'remote.example.com', 
    'password' => 'luggage12345',
);

$_result = $xmlapi->xmlapi_query('create_remote_user_transfer_session' , $settings);

print $_result;

This function returns the following transfer session ID in the  transfer_session_id value:

In this example, vm5docscpanelnoroo201402251939519hmy is the transfer session ID.







Additional documentation