Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Current »

Information

ZCB 4.8 and higher supports restore from the command line. These commands can be placed into a batch script for automation purposes.

Limitations of Command-line Restores

Icon

Command-line and automated restores have certain limitations.

  • ZCB must be installed and require that a valid cloud certificate be imported.
  • Restores via the command line may be restored to the Original Location or to an Alternate Location.
  • All restores via command line are of the most recent backups. You cannot choose a previous restore point.

Additionally, all requirements for restore must be met, as noted in the User's Guide.

Command-line Restores

To restore from the command line, open a command prompt and navigate to the \bin\ folder in your ZCB installation directory.

There are two commands available. One performs a Restore Catalog operation to allow restore of data from a different machine. The other performs the restore itself.

Icon

There are no progress bars or other indicators when performing command-line restores of catalogs or data.

Restore Catalogs via Command Line

CloudController.exe --command restorecatalog --restoretype <cloud / local> --updatebackupfolder <1 / 0> --restorelocation <Path> --hostname <localhost / * / HOSTNAME> --backupset <Backupset name / *> --cloudLocation <Location>
Icon

This step is not necessary unless data needs to be restored from another machine or if ZCB was just installed on the current machine.

Arguments

The command to restore catalogs accepts a number of arguments that allow some flexibility.

  • --restoretype <cloud / local> 
    • This argument defaults to cloud if not specified
    • Choose cloud to restore from the cloud storage
    • Choose local to restore from local disk
  • --updatebackupfolder <1 / 0>
    • This argument defaults to 1 if not specified
    • This argument controls whether the Backup Folder location is updated in the ZCB database.
      • It must be set to 1 for catalog restores from local disk.
      • Catalog restores from cloud should be set to 1 unless otherwise instructed by Support representatives.
  • --restorelocation "<Path>"
    • This argument is required. The command will fail if restorelocation is not specified.
    • This argument has two purposes:
      • When restoring catalogs from cloud, the path specified here is where the catalog information (.zib and .index files) will be stored on disk after download.
      • When restoring catalogs from local disk, the path specified here should point to the location on disk where the backups are stored
        • It is required to run the local restore catalog command multiple times if multiple backup sets are each located in a separate directory.
    • Example path: "C:\My\Catalog\Folder"
      • Place quotation marks around the entire path.
  • --hostname <localhost / HOSTNAME / *>
    • This argument is required.The command will fail if hostname is not specified.
    • Choose localhost to restore backups for the local machine only.
    • Input the HOSTNAME of a specific machine to restore backups of that machine only.
    • Place an asterisk * to restore backups for all machines
  • --backupset <Name of backup set / *>
    • This argument defaults to * (all backup sets) if not specified
    • Input the name of a specific backup set to restore that backup set
    • Input an asterisk to restore all backup sets
    • This argument also supports pattern matching using an asterisk.
      • Example: MSSQL*, *Data, etc.
  • --cloudLocation <location>
    • This argument defaults to blank (all locations) if not specified
    • Leave the location blank to restore from all cloud locations
    • Input the name of a specific location to restore backups from all locations. 
      • US (For US Standard)
      • ap-southeast-1 (For Singapore)
      • ap-northeast-1 (For Tokyo - Japan)
      • ap-southeast-2 (For Sydeny - Australia)
      • EU (For Europe)
      • sa-east-1 (Sau Paolo - South America)
      • us-west-1 (North California - US West)
      • us-west-2 (Oregon - US West)

Example commands to restore catalogs

Restore catalogs for all backup sets in all cloud locations for all machines
CloudController.exe --command restoreCatalog --restoretype cloud --updatebackupfolder 1 --restorelocation "C:\My\Catalog\Folder" --hostname * --backupset * --cloudLocation
Restore catalogs for the backup set MyBackup from the SERVER2 machine stored in the Tokyo location
CloudController.exe --command restoreCatalog --restoretype cloud --updatebackupfolder 1 --restorelocation "C:\My\Catalog\Folder" --hostname SERVER2 --backupset MyBackup --cloudLocation ap-northeast-1
Restore catalogs for backup sets MyBackup from the FILESERVER machine stored on local disk in C:\Where\My\Backup\Is\Located
CloudController.exe --command restoreCatalog --restoretype local --updatebackupfolder 1 --restorelocation "C:\Where\My\Backup\Is\Located" --hostname FILESERVER --backupset MyBackup

Restore Data via Command Line

Once catalogs have been restored, or if you have an existing, healthy ZCB installation on the machine, you may restore data from the command line.

To restore to the Original Location

CloudController.exe download "<Hostname+Backupsetname / *>" restore "<Download folder path>"

To restore to an Alternate Location

CloudController.exe download "<Hostname+Backupsetname name / *>" restore "<Download folder path>" "<Restore folder path>"

Arguments

The command to restore data accepts a number of arguments that allow some flexibility.

  • download "<Hostname+Backupsetname name / *>"
    • Input the name of a specific backup set to restore data from that backup set only.
      • The backup set name should be in the "Hostname+Backupsetname" format as seen in the "<ZCB installation directory>\zcb\conf' folder.
    • Choose * to restore all backup sets
    • The quotation marks are required.
  • restore "<Download folder path>" "<Restore folder path>"
    • The Download Folder path controls where the backup archive will be downloaded to disk.
      • In case of local backups, specify the folder where the backup archive already exists.
    • The Restore folder path controls the folder to which the data will ultimately be restored.
      • If no value is entered for the Restore folder path, the data will be restored to its original location.!
    • Example path: "C:\My\Download\Folder"
      • Place quotation marks around the entire path

Example commands to restore data

Restore data for all backup sets to the Original Location and store the backup archive in C:\My\Download\Folder
CloudController.exe download "*" restore "C:\My\Download\Folder"
Restore data for the backup set MyBackups to the Original Location from the FileServer machine and store the backup archive in C:\My\Download\Folder
CloudController.exe download "FileServer+MyBackups" restore "C:\My\Download\Folder"
Restore data for the backup set FileSystem to D:\My\Restore\Folder from the FileServer machine and store the backup archive in C:\My\Download\Folder
CloudController.exe download "FileServer+FileSystem" restore "C:\My\Download\Folder" "D:\My\Restore\Folder"

Automated Restores

Batch files can be created using the above command-line options. These batch files can be run manually to make command-line restores easier, or they can be run automatically with Windows Task Scheduler.

Example batch file

Here is a sample batch file that can be run to restore backups from all backup sets on all machines in all locations.

RestoreAutomation.bat

This file can be edited to support your needs, or you may write your own using the command-line options above.

 

  • No labels