Restore a single file using Azure Backup

The best Azure learning site: Azure Documentation Center / Microsoft Learning

Restore a single file using Azure Backup

Earlier, I introduced how to use Azure Backup to back up cloud VMs and use the backup files to restore when there is a problem with the virtual machine. However, the method of directly recovering virtual machines is not suitable for all business scenarios. In many cases, we hope to have some fine-grained recovery control. For example, the operation and maintenance personnel accidentally deleted or changed some important configurations during the configuration of the system. In this case, we can use Azure Backup to restore based on the file level. Compared with restoring the entire VM, the interruption time and workload of the business can be greatly reduced. For more information about Azure Backup, you can refer to the following address:

https://docs.microsoft.com/en-us/azure/backup/backup-overview?WT.mc_id=AZ-MVP-5002232

Let's take a look at how to restore a single file using Azure Backup.

prerequisites

To perform this experiment, the following prerequisites must be met:

  • Azure subscription
  • A Linux virtual machine running Nginx
  • Enable Azure Backup for the virtual machine


Delete files from the VM

We deleted webpage files from the VM to simulate misoperation, which caused the site to be unavailable.

Log in to Azure Portal and find the VM we have prepared:

clip_image002

You can see that the current Nginx site is running normally by visiting the public IP address:

clip_image004

SSH to the server, run rm -rf /var/www/html/index.nginx-debian.html to delete webpage files:

clip_image005

After deleting, visit the site, you can see the site access exception:

clip_image007

Generate file recovery script

In the scenario of recovering a single file, Azure Backup provides a recovery script to connect the recovery point to the VM as a local disk. After connecting, we can browse the disk to restore the file. The recovery point can be disconnected after the file is restored.

Click on all services, click on restore service vault:

clip_image009

After entering the recovery service vault, click on the backup item, and then click on the Azure virtual machine:

clip_image011

Click on the Demo-Web01 we want to use:

clip_image013

In the backup item, click File Recovery:

clip_image015

On the File Recovery tab, select the recovery point you want to use, then download the script and record the script running password:

clip_image016

Restore files to VM

Log in to the virtual machine and find the script file we downloaded:

clip_image018

After running the script file, we will be asked to enter the password, we can enter the password recorded before:

clip_image020

The recovery point is mounted:

clip_image022

Find the file to be restored in the local drive mounted on the restore point to restore:

clip_image024

After the restoration is complete, we visit the previous site again and we can see that we can access it normally:

clip_image026

After the recovery is complete, we need to cancel the mount of the recovery point in the file recovery menu:

clip_image028

The cancellation is complete, as shown in the figure below:

clip_image029

This is the end of the operation of using Azure Backup to restore a single file. I hope it will be helpful to you.

For more information, please refer to the following link:

https://docs.microsoft.com/en-us/azure/backup/backup-overview?WT.mc_id=AZ-MVP-5002232

Guess you like

Origin blog.51cto.com/wuyvzhang/2601590