Restore Images
Use the command line interface to restore your image-based backups.
Create a Restore Plan
Use the addIbbRestorePlan command to create and configure a new image-based restore plan.
C:\Program Files\MyCompany\Online Backup\cbb addIbbRestorePlan -?
Required Parameters
The following parameters are required to execute the addIbbRestorePlan command.
-n Specifies the name of a created image-based restore plan.
-a or -aid Specifies the name or ID of a storage account where your backups are stored.
-did (-diskID, -diskFromBackup) or -v (-selectedVolume)
Indicates the disk or disk volume ID in an image-based backup.
You can find out which disks are available in your backups by executing the listIbbContent command (see the Manage Image-Based Backups section of this document to learn more about using this command).The volume ID should correspond to the WindowsVolumeIdentity value returned by the listIbbContent command executed with the "-listVolumes" parameter.
Specify one of the following parameters to restore an image-based backup to a physical disk or disk volume.
-pd (-physicalDisk) Identifies a physical disk to which to restore a selected disk image. You can find information about the disks available on your system by executing the listIbbContent command.
-pv (-physicalVolume)
Identifies a particular physical volume to which you would like to restore your backup. You can find information about the disk volumes available on your system by executing the listIbbContent command with the "-listVolumes" parameter.
The following example illustrates how to restore a disk image to a physical disk.
cbb addIbbRestorePlan -n "plan_name" -a "account" -diskID "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -physicalDisk "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd"
The following example illustrates how to restore a disk volume to a physical volume.
cbb addIbbRestorePlan -n "plan_name" -a "account" -selectedVolume "58a6f458-8948-4ad7-aea7-a7ade7aba85e" -physicalVolume "58a6f458-8948-4ad7-aea7-a7ade7aba85e"
Alternatively to restoring an image to a physical disk, you can specify the following parameters to restore your backup to a virtual disk of a required type.
- -vdt (-virtualDiskType) Specifies the virtual disk type. You can set this parameter to any of the following values.
- "Hyper-V Virtual Disk (VHD-format) dynamic "
- "Hyper-V Virtual Disk (VHD-format) fixed "
- "Hyper-V Virtual Disk (VHDX-format) dynamic "
- "RAW disk image raw "
- "RAW disk image rawsparse "
- "RAW disk image tar "
- "RAW disk image tgz "
- "VirtualBox Virtual Disk dynamic "
- "VirtualBox Virtual Disk fixed "
- "VMware Virtual Disk vmfsdynamic "
- "VMware Virtual Disk vmfsfixed"
- -vdn (-virtualDiskName) Specifies the name of a created virtual machine file.
- -vdf (-virtualDiskFolder) Specifies the destination folder for your virtual machine file.
The following example illustrates how you can create a plan for restoring a specified disk to a virtual machine of your choice.
cbb addIbbRestorePlan -n "plan_name" -a "account" -diskID "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -virtualDiskType "Hyper-V Virtual Disk (VHD-format) fixed" -virtualDiskName "disk_name" -virtualDiskFolder "C:\Disk"
Optional Parameters
You can use the following parameters to configure your image-based restore plan.
-bp
Specifies the backup prefix. Use this parameter when restoring a backup made from another computer to access the storage destination for backup data retrieving.Please ensure that the specified backup prefix is correct. You can list backup prefixes available in specified storage by executing the cbb prefixes command.
-rt and -rpt
Use the "-rt" parameter to specify whether to restore the latest version of your disk image available in specified backup storage or the latest version available in the backup storage at a specified point in time. Possible values: "LatestVersion" (the default value) or "PointInTime".Backups include only files that were modified since the previous backup date. As a result, selecting this option will restore only those file versions that were modified before the most recent backup and are not yet available in the destination folder.
When the "-rt" parameter is set to "PointInTime", you should specify the "-rpt" parameter as well, indicating a required point in time.
For example, the following command creates a plan for restoring the latest version of a disk image that is available in the backup storage at a specified point in time.
cbb addIbbRestorePlan -n "plan_name" -a "account" -diskID "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -physicalDisk "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -rt PointInTime -rpt "4/27/2018 3:00:00 PM"
-ep Specifies the password to restore an encrypted disk/volume image. These files will not be restored unless you have specified a valid encryption password.
Executing Custom Scripts
Use the following parameters to execute custom scripts before and/or after running a restore plan.
- -preAction Specifies a command to execute before executing the plan.
- -pac Indicates whether or not the backup service should continue processing the restore plan if the pre-backup action failed.
- -postAction Specifies a command to execute after completing the restore plan.
- -paa Indicates whether the backup service should execute the post-backup action regardless of the restore plan processing result.
The following command creates a new restore plan and specifies custom scripts to be executed before and after running this plan.
cbb addIbbRestorePlan -n "plan_name" -a "account" -diskID "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -physicalDisk "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -preAction "C:\_Temp\script.cmd /F:ON /C" -pac yes -postAction "PowerShell.exe Start-Process cmd.exe exit" -paa no
Customizing Scheduling Settings
Use the following parameters to have your restore plan run automatically on schedule.
-at
Specifies the time at which the restore plan should run. If no other scheduling parameters are defined, the restore plan should run at this time on the day of this plan's creation.
This parameter is required if you need to run your restore plan on a recurrent basis and specify corresponding scheduling options described below.
Instead of using the "-at" parameter, you can use the "-occurs" parameter (see below) to run the restore plan once in a specified number of hours or days.You can specify both the date and time if you do not need to run your restore plan on a recurring basis, for example:
cbb addIBBRestorePlan -n "plan_name" -a "account" -diskID "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -physicalDisk "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -at "5/28/2018 6:00 PM"
-every Enables you to run the restore plan on a recurring basis. The following values are supported:
"day"
Enables running the restore plan every day. For example:cbb addIBBRestorePlan -n "plan_name" -a "account" -diskID "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -physicalDisk "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -at "6:00 PM" -every day
"week"
Enables running the restore plan every week. Use the "-weekday" parameter to specify one or more weekdays. For example:cbb addIBBRestorePlan -n "plan_name" -a "account" -diskID "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -physicalDisk "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -at "6:00 PM" -every week -weekday "su, mo"
"month"
Enables running the restore plan on a monthly basis. If no other scheduling parameters are defined, the restore plan will run every month on the first Sunday by default. You can use the "-weekNumber" and "-weekday" parameters to specify a custom monthly schedule. For example, the following plan will be executed on the third Monday of every month.cbb addIBBRestorePlan -n "plan_name" -a "account" -diskID "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -physicalDisk "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -at "6:00 PM" -every month -weekNumber "third" -weekday "mo"
- The following values are supported for the "-weekNumber" parameter: "first", "second", "third", "fourth", "penultimate", "last".
- The following values are supported for the "-weekday" parameter: "su", "mo", "tu", "we", "th", "fr", "sa".
"dayOfMonth" Not supported.
-occurs
When the "-every" parameter is set to "day" (see above), indicating that the restore plan should run on a daily basis, you can make the restore plan run once in a certain number of hours or days within a specified time period by using the "-occurs" parameter instead of "-at".If the "-every" parameter is set to "day", specifying both the "-occurs" and "-at" parameters at once will result in an error.
The following values are supported for the "-occurs" parameter:
- "day" - enables running the restore plan once in a specified number of days.
- "hour" - enables running the restore plan once in a specified number of hours.
After specifying this parameter, use the "-occurValue" parameter to specify how many hours or days should pass before each run.
Also, you can use the "-dailyFrom" and "-dailyTill" parameters to specify the time range within which the recurrence should take effect. The time range format is : "dd.hh:mm:ss".
The following example illustrates how to make a restore plan run every two hours between 6:00 AM and 6:00 PM every day.
cbb addIBBRestorePlan -n "plan_name" -a "account" -diskID "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -physicalDisk "c5117cb2-8a50-48a1-b8b0-8bc3aa5077fd" -every day -occurs hour -occurValue 2 -dailyFrom "00.06:00:00" -dailyTill "00.18:00:00"
Additional Options
The following parameters define the standard output format for this command.
- -json Send the status to stdout in a JSON format.
- -xml Send the status to stdout in an XML format.