Restoring a SQL Server availability database to the primary and the secondary replicas
In some situations you may need to restore the SQL Server availability databases to both the primary and the secondary replicas. These situations can include when you restore databases:
You may want to perform this restore for the primary database in parallel with the restores for the secondary databases.
To restore any system databases or user databases in the backup, perform a separate browse and restore operation using the replica name.
To restore a SQL Server availability database to the primary and the secondary replicas
- Log on to the host of the primary replica.
- Open SQL Server Management Studio and perform the following tasks:
Suspend data movement on the database.
Remove the database from the availability group.
- Close any connections to the database.
- Remove the primary database from SQL Server.
- In the NetBackup MS SQL Client, select File > Set SQL Server connection properties.
- From the Instance list, select the instance that hosts the availability group.
- Browse for the backup images you want to restore. Select the latest full backup image and transaction log backups.
- Select the following settings:
Select Use replace option.
From the Recovery list, select Recovered.
- Click Restore.
- When the restore completes, add the database to the availability group using the Skip initial data synchronization option.
- Log on to the host of the secondary replica and complete the following steps:
Close any connections to the database on the secondary replica.
Remove the secondary database from SQL Server.
- In the NetBackup MS SQL Client, select File > Set SQL Server connection properties.
- From the Instance list, select the instance that hosts the availability group.
- Browse for the backup images you want to restore. Select the same set of images that you restored to the primary replica.
- Select the following settings:
From the Recovery list, select Not recovered.
Select Use replace option.
- If the replicas in the availability group 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 availability group.
- Repeat step 11 through step 18 for additional replicas in the availability group.