Restoring a SQL Server availability group database to a secondary replica
This procedure describes how to restore a SQL Server availability group (AG) database to a secondary replica. Follow this procedure if a secondary replica is unavailable for an extended time and needs to be synchronized with the primary. Or you can follow these instructions after you add a new secondary replica to the AG.
To restore a SQL Server availability group database to a secondary replica
- If you did not already, configure the mappings for distributed application restores.
Map the WSFC (Windows Server Failover Cluster) name to each AG node. If you have an AG with an FCI, you must configure additional mappings.
Configure these mappings in the Distributed Application Restore Mapping host property on the master server.
See Configuring mappings for restores of a distributed application, cluster, or virtual machine .
- If you did not already, review the auto-discovered mappings for the hosts in your environment.
Approve each valid Auto-Discovered Mapping that NetBackup discovers in your environment. Perform this configuration in the Host Management properties on the master server.
See Reviewing the auto-discovered mappings in Host Management.
- Log on to the node that hosts the secondary replica.
- Close any connections to the database on the secondary replica.
- Remove the secondary database from the AG.
- Open the NetBackup MS SQL Client.
- Select File > Set SQL Server connection properties.
- From the Instance list, select the instance that hosts the AG.
- Select File > Restore SQL Server objects.
- In the Backup History Options dialog box, for the Source Client, select or type the full qualified domain name (FQDN) of the Windows Server Failover Clustering (WSFC) cluster.
You can find the cluster name in Failover Cluster Manager or the job details for the backup.
NetBackup displays the databases that are included in the availability group. To restore any system databases or user databases in the backup, perform a separate browse and restore operation using the node name.
- Click OK.
- In the Restore Microsoft SQL Server Objects dialog box, select the latest full backup image and transaction log backups.
- From the Recovery list, select Not recovered.
- Select Use replace option.
- If the nodes in the AG use different paths for the database file, you need to create a move template to restore to a secondary replica. From the Scripting list, choose Create a move template.
- Click Restore.
- When the restore completes, join the database to the AG.