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.
Comments
Anonymous
January 01, 2003
@Edgar Corona You can follow the instructions here (social.technet.microsoft.com/.../e6cca0bb-d65b-4f0a-a940-65125ebb004e). Basically you'll be reactivating the Archiving Server role with the new location for the database.Anonymous
April 04, 2011
Do you have the command to move LCSLog database?Anonymous
August 10, 2012
The first step is to stop all of the OCS services on all of the servers in the pool. ======Also set them to manual so, that they do not start by themselves===============