Restoring Files with Azure File Sync

cloud
In this post, I will show you how to restore files that were synchronized to the cloud, using Azure File Sync, and backups up using Azure Backup.
Note that this post is based on the preview release of Azure Backup support for Azure Files.

Demo Lab

In my lab, a file server is synchronizing three shares (Accounting, Marketing and Sales) to the cloud using Azure File Sync. Each share is in its own sync group and is synchronizing to an Azure Files share in a general purpose storage account. Each Azure Files share is named after the synchronized folder on the file server (accounting, marketing and sales).

I have already deployed Azure Backup to protect the files and the backups are stored as snapshots with the Azure Files share in the storage account.

Restoring a Share

I have created a scenario where all of the files in the Accounting share were deleted on the file server, and this damage was synchronized to the share in Azure Files. This could also have been a ransom-ware attack. Now I will show how to restore the entire share in the storage account.
You will start the restore process in the Manage Backups blade which you can reach by:

  • Navigating to the share in the storage account > Files and clicking Manage Backups.
  • Browsing to Backup Items in the recovery services vault that is managing the backups, and opening the share in question under Azure Storage (Azure Files).

Starting a restore for an Azure File Sync share in Manage Backups [Image Credit: Aidan Finn]
Starting a restore for an Azure File Sync share in Manage Backups [Image Credit: Aidan Finn]
Click Restore Share if you want to recover every item in the share. A Select Restore Point blade appears; select the backup job that you want to restore from, and then click OK. A Select Restore Location blade allows you to:

  • Restore to the original location or a new location
  • Choose how to handle conflicts: Overwrite Existing or Skip

In my case, I restored to the original location and chose to overwrite any existing files (as if I was hit by ransom-ware). I clicked OK and then confirmed the task by clicking Restore. A restore job began and the files were restored from the snapshot to the original location in the share. You can monitor the restore progress in Backup Jobs in the recovery services vault.

Monitoring the restore job of an Azure File Sync share [Image Credit: Aidan Finn]
Monitoring the restore job of an Azure File Sync share [Image Credit: Aidan Finn]
It took just under 14 minutes to restore nearly 4,000 files, with each file being nearly 7 MiB in size. A few minutes later, all of the files appeared in the share on the file server – this was fast because the files are “offline” (“O” attribute), meaning that users can see the files with their original names, locations, and permissions, but they are actually reparsed points or pointers that redirect to the master copies in the cloud. If a user opens the file, it is downloaded from the cloud via the file server.

Restoring a File

You can also restore one or a subset of files from a backup. In this example, I am going to restore a file from the Accounting share to a different share in the same storage account – it could be any existing storage account in the same region.
Once again, I opened Manage Backups for the share, but this time I click File Recovery. I chose a restore point to recover from, and then the Select Restore Location Blade appeared, which allows you to specify the Recovery Location, which can be either the original share or another share in the same or another storage account. I chose Alternative Location, and then entered:

  • Storage Account: I selected the same storage account, but I could have selected another one.
  • Select File Share: Choose a share that already exists in the storage account.
  • Folder Name: You can leave this empty to restore the file to root (/) or enter a folder to restore the file into.
  • In Case Of Conflicts: Overwrite the existing copy or create a new copy of the file.

Recovering a file from an Azure File Sync backup [Image Credit: Aidan Finn]
Recovering a file from an Azure File Sync backup [Image Credit: Aidan Finn]
Then you click Select File to choose the file(s) that you want to restore and click OK. When you’re sure, click Restore and an Azure Backup restore job will be triggered.
The file, which was 6.83 MiB in size, was restored to the new share in 83 seconds, and appeared on the file server soon after.