Veeam Backup & Replication allows you to perform staged restore — run an executable script for VMs before recovering them to the production environment.
Staged restore can help you ensure that recovered VMs do not contain any personal or sensitive data. For example, you can instruct Veeam Backup & Replication to run a Windows PowerShell script that removes Active Directory users:
$UserName = "John.Smith"
$ADUser = Get-ADUser -Filter 'Name -like $UserName'
Remove-ADUser -Identity $UserName -Confirm:$false
Stage restore is available only for entire VM restore operations. To perform staged restore, you must select the Staged Restore mode in the Full VM Restore wizard and specify staged restore settings.
Before you perform staged restore, check the following prerequisites:
- The staged restore functionality is available in the Enterprise and Enterprise Plus editions of Veeam Backup & Replication.
- You must have a preconfigured virtual lab in your backup infrastructure. For more information, see Virtual Lab.
- Scripts that you plan to run must reside in a local folder on a backup server.
- If you plan to perform staged restore for several VMs within one restore session, make sure these VMs run OS of the same type: either Microsoft Windows or Linux. In the current version of Veeam Backup & Replication, you cannot specify credentials and scripts for each VM individually.
- When restoring VMs, Veeam Backup & Replication uses Veaam Quick Migration method. vMotion and Storage vMotion methods cannot be used. For more information on Quick Migration methods, see Quick Migration.
How Staged Restore Works
For staged restore, Veeam Backup & Replication uses a preconfigured virtual lab, an executable script located on the backup server, and credentials to connect to VMs and run the script. Veeam Backup & Replication performs staged restore in the following way:
- In the virtual lab, Veeam Backup & Replication starts VMs directly from compressed and deduplicated backup files that reside on the backup repository. To achieve this, Veeam Backup & Replication uses the Veeam vPower NFS Service.
If you selected to use an application group to run a script, Veeam Backup & Replication first starts VMs from the application group in the required order.
- Veeam Backup & Replication copies the script from the backup server to VMs that you plan to restore.
To connect to VMs, Veeam Backup & Replication uses credentials specified in staged restore settings.
- Veeam Backup & Replication runs the copied script on every VM.
To run the script, Veeam Backup & Replication uses the same technology as for pre-freeze and post-thaw scripts. For more information, see Pre-Freeze and Post-Thaw Scripts.
- All VM changes that take place during script execution are written to VM delta files.
By default, Veeam Backup & Replication stores delta files on the vPower NFS server. You can change the destination for VM delta files in virtual lab settings.
- After the script execution is complete, Veeam Backup & Replication powers off VMs in the virtual lab.
- Veeam Backup & Replication restores VMs in a changed state to the production environment.
To achieve that, Veeam Backup & Replication copies VM data from the backup repository and delta files to the target host using Veeam Quick Migration.