How to Move OCS Enterprise SQL Database to another Server

The first step is to stop all of the OCS services on all of the servers in the pool.  Next you will want to backup the existing databases (rtc, rtcconfig, and rtcdyn).  Open SQL Management Studio and connect to the instance that holds the OCS databases.  Right click on each and go to Tasks > Backup.
 

Make sure that the selected backup type is "Full".  Then select a location to backup the databases to and click OK.  Do this for each of the databases.

 

Once you have all of the databases backed up, we can restore them to the other SQL server.  Open SQL Management Studio and connect to the instance that will hold the OCS databases.  Right click on Databases and click on Restore Database.

Select the backup file for each database and click on Options.

Make sure that the Restore As path is correct for the new server, then click OK.  Repeat this until you have all 3 databases restored.

 

Next you will have to re-create the SQL Logins on the new server.  In SQL Management Studio, click the New Query button and paste the following query, making sure to replace <domain> with your domain name, and then run the query.

CREATE LOGIN [<domain>\RTCHSUniversalServices] FROM WINDOWS WITH DEFAULT_DATABASE=master;
CREATE LOGIN [<domain>\RTCArchivingUniversalServices] FROM WINDOWS WITH DEFAULT_DATABASE=master;
CREATE LOGIN [<domain>\RTCComponentUniversalServices] FROM WINDOWS WITH DEFAULT_DATABASE=master;
CREATE LOGIN [<domain>\RTCUniversalServerAdmins] FROM WINDOWS WITH DEFAULT_DATABASE=master;
CREATE LOGIN [<domain>\RTCUniversalUserAdmins] FROM WINDOWS WITH DEFAULT_DATABASE=master;
CREATE LOGIN [<domain>\RTCUniversalReadOnlyAdmins] FROM WINDOWS WITH DEFAULT_DATABASE=master;
EXEC sp_dboption 'rtc', 'db chaining', TRUE
EXEC sp_dboption 'rtcdyn', 'db chaining', TRUE

What is 'db chaining'?  Take a look at this article to learn more about database chaining, https://msdn.microsoft.com/en-us/library/ms188676.aspx.
 

The last thing you need to do is update the pool to point to the new location.  Run the following command from a front-end server in the pool:

LCSCmd.exe /Forest /Action:UpdatePoolBackend /PoolName:<pool name> /poolbe:<SQL instance name (machine\instance name)>

 

You can now start all of the OCS services on all of the front-end servers in the pool.

 

Thanks to Brian Smith for help with this post.