Introduction

When you monitor the transfer session, you check the status of the transfer session.

Use the same process for both the root and transfer sessions.

Determine the state of the transfer session

To determine the state of a transfer session, use the WHM API 1 get_transfer_session_state function.

Select the tab below that corresponds to the method by which you wish to call the function:




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, 'transfer_session_id'=>'remoteexamplecomnoroo20140501194105g7qG');
$_result = $xmlapi->xmlapi_query('get_transfer_session_state' , $settings);

print $_result;



The function will respond with one of the following states:

  • TRANSFER_PENDING
  • TRANSFER_INPROGRESS
  • RESTORE_PENDING
  • RESTORE_INPROGRESS
  • PENDING
  • COMPLETED
  • FAILED

In the following example, the transfer session is in progress:

Review the master log

Review the master log for the transfer session with the WHM API 1 fetch_transfer_session_log function.

Select the tab below that corresponds to the method by which you wish to call the function:




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, 
    'transfer_session_id'=>'remoteexamplecomnoroo20140501194105g7qG' , 
    'logfile' => 'master.log'
);
$_result = $xmlapi->xmlapi_query('fetch_transfer_session_log' , $settings);

print $_result;



The following example shows the contents of a log file:

Each log file contains the following information in a line-delimited JSON format:


Create a script to parse this log file to determine the progress of the transfer or restore operation.