move_database()

Move a database.

Signature

move_database(array $parameters): mixed

Parameters

Pass these parameters as KasRequestParams. Every request also requires kas_login, kas_auth_type, and kas_auth_data, as shown in SOAP with PHP.

Name Description Requirement
database_login The database to move Required
source_account The source account Required
target_account The target account Required
adjust_resources Y = adjust limits automatically if the target account has no free database left (optional, default N). Only the full accounts from the target account upwards are increased until an account has free capacity. If no account up to the common parent account of source and target has free capacity, the limits of the source account and its parent accounts up to that point are reduced by 1. If the target account has free capacity, nothing is changed. Optional Default: N

PHP example

<?php

// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
    'database_login' => 'd0123456',
    'source_account' => 'w000XXXX',
    'target_account' => 'w000YYYY',
];

try {
    $client = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl');
    $response = $client->KasApi(json_encode([
        'kas_login' => 'w0123456',
        'kas_auth_type' => 'session',
        'kas_auth_data' => $sessionToken,
        'kas_action' => 'move_database',
        'KasRequestParams' => $parameters,
    ]));
    print_r($response);
} catch (SoapFault $fault) {
    echo 'Error: ' . $fault->faultstring;
}

Responses and error codes

  • TRUE the action was carried out
  • missing_parameter a required parameter is missing
  • kas_login_syntax_incorrect
  • target_is_equal_to_source
  • host_is_dummyhost
  • account_doesnt_belong_to_you
  • account_is_on_different_server
  • target_is_dummyaccount
  • database_not_found_in_kas
  • max_database_for_subaccount_gt_change_value only without adjust_resources=Y
  • couldnt_get_kas_ressources only with adjust_resources=Y
  • adjust_resources_unlimited_on_path only with adjust_resources=Y: an affected account has unlimited resources
  • adjust_resources_exceeded_on_path only with adjust_resources=Y: an affected account uses more than it is allowed to
  • adjust_resources_limit_below_zero only with adjust_resources=Y: a limit would fall below 0
  • adjust_resources_failed only with adjust_resources=Y: the limits could not be set, nothing was moved
  • adjust_resources_rollback_failed only with adjust_resources=Y: the limits could not be reset after an error
  • couldnt_move_database only without adjust_resources=Y: the database could not be moved, nothing was changed