How can we Help ?

How do I restore data on Linux / FreeBSD / Solaris via the command line?

The first thing to note is you may restore from any browser via the management portal.  However this may not be feasible if this is a server.

Restoring a backup from the command line takes a bit of preparation, but the process itself is simple.


  1. First we need to amend a script file called "Restore.sh" which is located in ${backup software-Install-Home}/bin: (typically /opt/obm/bin)
    nano /opt/obm/bin/Restore.sh
  2. Under the 'User Define' section, edit the BACKUP_SET field to include the backup set name OR the backup set ID number:
    ...
     # -----------------------------  BACKUP_SET  ----------------------------------------------------------
     # | The name or ID of the backup set that you want to restore                  
     # | If backup set name is not in English, please use BackupSetID               
     # | e.g. BACKUP_SET="1119083740107"                                            
     # |  or  BACKUP_SET="FileBackupSet-1"                                          
     # |                                                                            
     # | You can leave this parameter blank if you have only 1 backup set.          
     # --------------------------------------------------------------------------------------------------------------------
     BACKUP_SET="file-backup-set-01"
    ...

    Note:
    The backup set ID can be obtained from the Backup Summary that is located on the top left corner of the backup report.  The backup set name can be obtained from the backup report or through the management portal.

  3. Edit the RESTORE_TO field with the restore destination directory path:
    ...
     # -----------------------------  RESTORE_TO  ----------------------------------------------------------
     # | Directory to where you want files to be restored                           
     # | set to "" to restore files to original location                            
     # | e.g. RESTORE_TO="/tmp"                                                     
     # -------------------------------------------------------------------------------------------------------------------
     RESTORE_TO="/tmp"
    ...
  4. Edit the RESTORE_FROM field with the location of the folder that is to be restored:
    ...
     # -----------------------------  RESTORE_FROM  ---------------------------------------------------------
     # | File/Directory on the backup server that you would like to restore         
     # | e.g. RESTORE_FROM="/Data"                                                  
     # -----------------------------------------------------------------------------------------------------------------------
     RESTORE_FROM="/backup_source/folder"
    ...
  5. Note: It is not possible to select single file using the RESTORE_FROM field, only directory path can be used for this field.
    If unsure of the location for the data, please use the [File Manager] in the management portal to locate the folder location.
  6. Edit the POINT_IN_TIME field to select the snapshot to be restored:
    ...
     # -----------------------------  POINT_IN_TIME  ------------------------------------------------------------
     # | The point-in-time snapshot that you want to restore from the backup server 
     # | Use "Current" for the latest backup snapshot                               
     # | e.g. POINT_IN_TIME="2006-10-04-12-57-13"                                   
     # |  or  POINT_IN_TIME="Current"                                               
     # ------------------------------------------------------------------------------------------------------------------------
     POINT_IN_TIME="Current"
    ...
  7. If the latest snapshot is to be restored, the value "Current" can be used (e.g. POINT_IN_TIME="Current"). If the snapshot to be restored is not the latest, please specify the date and time of the backup job for restore (e.g. POINT_IN_TIME="2010-10-04-12-57-13").
    Note:  Date and time of a backup job can be obtained: 1) in the URL by opening a Backup Report on the management portal or 2) you may list the snapshots via the command line by running the following command:  server01:~# /opt/obm/bin/ListBackupJob.sh backup_set_name
  8. Edit the SETTING_HOME field to point to the location of the .obm folder: 
    ...
     # -----------------------------  SETTING_HOME  ----------------------------------------------------------
     # | Directory to your setting home.                                            
     # | e.g. SETTING_HOME="${HOME}/.obm"                                           
     # ------------------------------------------------------------------------------------------------------------------------
     SETTING_HOME="/root/.obm"
    ...
  9. Details of other options such as RESTORE_PERMISSION, SKIP_INVALID_KEY, SYNC_OPTION, REPLACE_EXISTING_FILE, FILTER are explained in the script file itself. If necessary, please edit these fields according to your requirement.
    Note: The SYNC option is will ensure that the output directory only contains data that was contained within the backup set, please pay extra attention if you are using this option as it is destructive to data that already exists within the destination directory.
    Ensure that the RESTORE_TO field is not set to the root path, as the option will synchronize the restore destination with the restore source.

  10. Once done, please save the changes and execute the "Restore.sh" script file.
    cd /opt/obm/bin
    ./Restore.sh
Average rating:0 (0 Votes)

Contact Information

  • XZBACKUP
    2850 Interstate Dr. #2, 33805
    Toll-Free: +1 800.213.2157
    US Local: +1 727.564.9230
    UK Local: +44 2036.080613
    Phone Hours: 9AM - 6PM EST
    E-mail: sales@xzbackup.com
    Website: www.xzbackup.com
Copyright © 2015 xzbackup.com. All rights reserved.