ServiceBus 1.1: "The database (SbManagementDB) located at SQL Server (10.xx.xx.22) is already configured." error when running Restore-SBFarm command.

The Problem:

================================

When using Restore-SBFarm command to restore a ServiceBus farm, you may get the the following error

Restore-SBFarm : Cannot validate argument on parameter
'SBFarmDBConnectionString'. The database (SbManagementDB) located at SQL
Server (10.xx.xx.22) is already configured.

 

The detailed error information can be found in the following MSDN post:

https://social.technet.microsoft.com/Forums/en-US/4161b264-5aa8-4898-9659-928bdc0559a9/restoresbfarm-how-to-make-this-work?forum=windowsazurepack

 

Solution:

================================

The reason of why you met the error is because Restore-SBFarm should be used in the following disaster recovery scenario only:

  1. The existing ServiceBus farm is corrupt but its databases are fine.
  2. You want to restore the ServiceBus farm to a NEW environment(ServiceBus is installed but not configured. There is no database yet.).
  3. In this case, the Restore-SBFarm command will read the configurations from the existing databases and use them to recreate the SBFarm on the new environment for you.
  4. After running Restore-SBFarm, you may also need to run other cmdlets like Add-SBHost to add hosts to the farm.

A successful running of the command can be found in the following screenshots below:

However, if the scenario is that the current ServiceBus farm’s database is corrupt and you want to restore everything back in the existing environment. Then you have to manually restore all SB related SQL databases first and then run different cmdlets like Restore-SBGateway
and Restore-SBMessageContainer.

All the details about these different disaster recovery scenarios can be found in the following article:

Disaster Recovery

https://msdn.microsoft.com/en-us/library/dn441405.aspx

 

Best regards,

WenJun Zhang