SALES: 1-800-867-1380
This topic has not yet been rated - Rate this topic

Recover Files and Folders Using the Azure Backup Agent

Published: February 20, 2012

Updated: April 7, 2014

Applies To: Windows Server 2008 R2 with SP1, Windows Server 2012

You can recover data that was backed up with Microsoft Azure Backup onto any server running Windows Server 2012 or Windows Server 2008 R2 SP1 that is connected to the Internet. This can be useful for disaster recovery situations where you are not able to get physical or network access to your servers. To continue operations, new servers can be configured at your temporary location and the data stored from the original servers can be restored onto the new servers, enabling users to regain access to their data faster.

In this document

noteNote
This topic includes sample Windows PowerShell cmdlets that you can use to automate some of the procedures described. For more information, see Using Cmdlets.

Recovering a backup with Microsoft Azure Backup requires that you have a valid Azure subscription and have installed the Azure Backup Agent and all of its prerequisites as described in Install Azure Backup Agent and upload the certificate. It also requires that you have registered the server with Microsoft Azure Backup as described in Register Servers with Azure Backup and taken at least one backup from the server as described in Schedule Backups Using the Azure Backup Agent. After these tasks are completed successfully, you can recover backups by using the Microsoft Azure Backup snap-in (obsadmin.msc) or by using Windows PowerShell cmdlets for Azure Backup.

Use this procedure to restore damaged or missing files and folders to the same server.

Do this step using Windows PowerShell

  1. Press the Windows logo key + Q to open the Apps menu, and then click Azure Backup Agent. The Azure Backup Agent snap-in should open.

  2. In the Action menu, click Recover Data to open the Recover Data Wizard. The Getting Started page is displayed. Click This server, and then click Next to continue.

  3. The Select Recovery Mode page is displayed. Choose one of the following modes:

    • Browse for files. Choose this option to browse the directory listing of the backup volume and specifically select the appropriate files or folders to recover.

    • Search for files. Choose this option to search for a specific file or folder by name. You can use wildcard characters to search for files or folders when you do not know the entire name.

    Click Next to continue.

  4. The Select Volume and Date page is displayed. From this page, you can select the volume and the point-in-time of the backup that you want to restore. If multiple backups were taken on a single day, you can use the drop-down arrow next to the time-of-day to select the backup that you want.

    Click Next to continue.

  5. The Select items to recover page is displayed. This page differs as follows, depending on whether you selected the Browse for files or Search for files option.

    1. Browse for files option Presents a tree control that you can navigate to select the files you want to recover.

    2. Search for files option Presents a text entry field where you can identify the volume to search and then type the file name or pattern to search for. Files that match the search criteria are listed so that you can select the files that you want to recover.

    After you have selected all of the files or folders that you want to recover, click Next to continue.

  6. The Specify recovery options page is displayed.

    Choose how to handle potential file conflicts during the recovery process by choosing one of the following options:

    • Create copies so that you have both versions This option makes a copy of the file with a new file name in the same location as the duplicate file. The file name of the new file starts with the following text string (<recovery date>Copy of<original file name>)

    • Overwrite the existing versions with the recovered versions This option overwrites the file, and the only version that will exist in the restore location is the recovered file version.

      CautionCaution
      The overwrite restoration option removes any file with the same file name. You should ensure that there is no valuable data that will be overwritten when you choose this option.

    • Do not recover the items that already exist on the recovery destination This option retains the current version of any files that already exist in the recovery destination. Recovery will occur only for data that does not exist in the recovery destination.

    In Security settings, select the check box to restore the access control list (ACL) settings of the files and folders that are recovered, or clear the check box to have the restored files and folders inherit the ACLs that are present in the recovery destination. Click Next to continue.

    WarningWarning
    Sharing settings are not recoverable. If a file or folder is shared when it is backed up, it will not be shared when it is recovered. You must reset the sharing settings manually after recovery.

  7. The Confirmation page is displayed. Verify that the items you are going to recover are the ones that you want and that they are being recovered to the correct location with the correct settings. If everything appears as you expect, click Recover to start the recovery process.

  8. The Recovery Progress page is displayed, which shows the progress of the recovery operation. You can close the wizard while the recovery is occurring and track the progress through the Microsoft Azure Backup snap-in. The Jobs pane shows the status of Job completed when the recovery is done.

PowerShell Logo Windows PowerShell equivalent commands

The following Windows PowerShell cmdlet or cmdlets perform the same function as the preceding procedure. Enter each cmdlet on a single line, even though they may appear word-wrapped across several lines here because of formatting constraints.

The following Windows PowerShell cmdlets provide an example of how you could perform a local recovery (data that is backed up by using and recovered to the same server):

$source = Get-OBRecoverableSource
$item = Get-OBRecoverableItem -Source $source[0]
$FinalItem = Get-OBRecoverableItem -ParentItem $item[0]
$paging_context = New-OBPagingContext

#To use the search function to find all .log files from a backed up location:
$search_page1 = Get-OBRecoverableItem –RecoveryPoint $item[0] –PagingContext $paging_context -SearchString *.log -Location C:\Windows\Logs


#To use the browse function to locate a certain file across backups, first establish the location parameters for the top and bottom of the search range: 
$recover_levelone = Get-OBRecoverableItem –PagingContext $paging_context -ParentItem $item
$recover_leveltwo = Get-OBRecoverableItem –PagingContext $paging_context -ParentItem $FinalItem

#Then run the recovery operation:
$recover_option = New-OBRecoveryOption
Start-OBRecovery -RecoverableItem $FinalItem -RecoveryOption $recover_option


This procedure steps you through the process of recovering data that was backed up on one server, and storing it on another server. This is known as “alternate server recovery.” Alternate server recovery is useful when your original server is no longer usable.

Do this step using Windows PowerShell

  1. Press the Windows logo key + Q to open the Apps menu, and then click Azure Backup Agent. The Azure Backup Agent snap-in should open.

  2. In the Action menu, click Recover Data to open the Recover Data Wizard. The Getting Started page is displayed. Choose Another server, and then click Next to continue.

  3. The Account Credentials page is displayed. Enter the user ID and password that you identified for use with Microsoft Azure Backup. Click Next to continue.

  4. The Select Backup Server page is displayed. You can choose a specific server name to recover data from, or you can search for data across all the servers that are registered with your subscription.

  5. The Select Recovery Mode page is displayed. Choose one of the following modes:

    • Browse for files Choose this option to browse the directory listing of the backup volume and specifically select the appropriate file or folder for recovery.

    • Search for files Choose this option to search for a specific file or folder by name across the servers that are registered with your subscription. You can use wildcard characters to search for files or folders when you do not know the entire name.

    Click Next to continue.

  6. The Select Volume and Date page is displayed. From this page, you can select the volume and the point-in-time for the backup that you want to restore. If multiple backups were taken on a single day, you can use the drop-down arrow next to the time-of-day to select the backup that you want.

    Click Next to continue.

  7. The Select items to recover page is displayed. This page differs as follows, depending on whether you selected the Browse for files or Search for files option.

    1. Browse for files option. You will be presented with a tree control through which you can navigate to select the files you want to recover.

    2. Search for files option. You will be presented with a text entry field where you can identify the volume to search and then type the file name or pattern to search for. Files that match the search criteria will be listed so that you can select the files you want to recover.

    When you have selected the files or folders to recover, click Next to continue.

  8. The Specify recovery options page is displayed.

    In Recovery destination, select Original location to recover the files to the same location on the server that they originated from or select Another location and then type the path to the location in the text box provided.

    Choose how to handle potential file conflicts during the recovery process by choosing one of the following options:

    • Create copies so that you have both versions. This option makes a copy of the file with a new file name in the same location as the duplicate file. The file name of the new file starts with the following text string (<recovery date>Copy of<original file name>)

    • Overwrite the existing versions with the recovered versions. This option overwrites the file, and the only version that will exist in the restore location is the recovered file version.

      CautionCaution
      The overwrite restoration option removes any file with the same file name. You should ensure that there is no valuable data that will be overwritten when you choose this option.

    • Do not recover the items that already exist on the recovery destination. This option retains the current version of any files that already exist in the recovery destination. Recovery will occur only for data that does not exist in the recovery destination.

    In Security settings select the check box to restore the access control list (ACL) settings of the files and folders that are recovered, or clear the check box to have the restored files and folders inherit the ACLs that are present in the recovery destination. Click Next to continue.

  9. The Confirmation page is displayed. Verify that the items you are going to recover are the ones that you want, and that they are being recovered to the correct location with the correct settings.

  10. The Recovery Progress page is displayed, which shows the progress of the recovery operation. You can close the wizard while recovery is occurring and track the progress through the Microsoft Azure Backup snap-in. The Jobs pane shows the status of Job completed when the recovery is done.

PowerShell Logo Windows PowerShell equivalent commands

The following Windows PowerShell cmdlet or cmdlets perform the same function as the preceding procedure. Enter each cmdlet on a single line, even though they may appear word-wrapped across several lines here because of formatting constraints. Placeholder text in these samples is denoted by the use of angle brackets. You should replace that entire item, including the brackets, with the appropriate information.

This example recovers data from one server to the destination specified on another server, and it overwrites duplicated data in that location.

$truepwd = "<password>"
$user = "<username@contoso.corp.com>"
$secureString = convertto-securestring -string $truepwd -asplaintext -force
$cstrial = new-object system.management.automation.pscredential $user, $secureString


$servers = Get-OBAlternateBackupServer -Credential $cstrial 
$source = Get-OBrecoverableSource -Credential $cstrial -Server $servers[0]
$item = Get-OBRecoverableItem -Source $source[0] -Credential $cstrial
$FinalItem = Get-OBRecoverableItem $item[0] -Credential $cstrial


$Path = "<Z:\Temp>"
$option = New-OBRecoveryOption -DestinationPath $Path 
$passphrase = "<passphrase>"
$secureString = convertto-securestring -string $passphrase -asplaintext –force

Start-OBRecovery -RecoverableItem $FinalItem -RecoveryOption $secureString -Credential $cstrial

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.