Restore VPS Backups

Use the Restore VPS Backups API to restore the backup of the VPS. Virtualizor allows you to restore the VPS to the original VPS or create a new VPS altogether using the backup image. To get the details of the backup directory and the date use the Backup VPS Details API. The API response will contain “restore_done” as “true” after the restoration process is initiated.

For more information, you can refer this Backup Plans guide.

HTTP Request

https://hostname:4085/index.php?act= vpsrestore


actGET vpsrestore This action will restore the vps whose backup exists and return restore_done as trueYes
vpsidPOSTIntThe ID of vps which needs to be restoredYes
dirPOSTtextThe directory where the backup image has been savedYes
datePOSTIntThe date at which the backup was taken should be in the format YYYYMMDDYes
newvpsPOST1/0If set a new VPS will be created using the backup fileNo

Sample Code



    $key =  'your_api_key'; //key of server on which vps is present.
    $pass = 'your_api_pass'; //pass of server on which vps is present.
    $ip = 'your_server_ip'; //ip of server on which vps is present.

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post = array();
    $post['vpsid'] = 79 ;
    $post['dir'] = '/tmp/api_backup' ;
    $post['date'] = 20180918 ;
    $post['newvps'] = 1 ; // Pass this if you want to restore to a new vps

    $output = $admin->vpsrestore($post);



    "title": "Restore VPS Backups",
    "restore_done": true,
    "restore_details": "",
    "timenow": 1537294345,
    "time_taken": "0.244"
Was this helpful to you?