Moving the CMS – Make it part of your upgrade action plan – Part 2

Install CMS on a Paired Pool

Pool Pairing was introduced in Lync 2013 to provide a Disaster Recovery (DR) solution which got around some of the limitations and complexities of using a stretched pool within Lync 2010. The DR uses the backup service to replicate data between the Pools which are paired. The CMS can also take advantage of this technology and even more so leverage a mirror within the DR site for HA in the remote Data Centre (DC).

The process is pretty much the same as installing within the primary DC (see Part 1) with a few added checks. To install the CMS on the Paired Pool, complete the following.

Check the backup service status between the Paired Pools, they should show as

  • Get-CsBackupServiceStatus -PoolFqdn {Pool FQDN} (CMS is hosted on this pool)
  • Get-CsBackupServiceStatus -PoolFqdn {Pool FQDN}

3

Note: For the Pool rea-sfb-se02… you would see OverallImportStatus in Error state because the XDS and LIS database are not yet available on that Pool. You may also see Event id 4082 on that Pools servers.

You should check that the SQL Server you are loading the CMS onto is the Principal for all the databases and its associated SQL Server contains all the Mirrors. Assuming all is correct at this stage, do one final check that replication is good using the Get-CsManagementStoreReplicationStatus cmdlet, if responses are TRUE then you can install the CMS.

Install-CsDatabase -CentralManagementDatabase –SQLServerFQDN {SQL Server FQDN} –DatabasePaths “E:\”, “D:\”

The SQL Server FQDN can be an SQL Server back-end or a Standard Edition Server. If a specific SQL Instance is required, this can be specified with the –SQLInstanceName switch. The –DatabasePaths switch is used to place the files, for example in the above command log files will be created on E:\ and databases on D:\ where possible and performance factors allow. Once the command has completed you should check on disk and within SQL Management Studio, the files and databases are shown.

Install CMS on a Paired Pool Mirror

Again similar to what we did on the first Pool we can also add SQL Mirroring within the DR site for HA within the DR site. This is the same process, but using the SQL Server Mirror within the DR site.

Just as with the first site mirroring you need to set-up and specify a file share. You should set-up a file share to be used as a “one off shot” for backing up and restoring the databases. This can be set-up providing everyone with full access and ripped down once the mirroring of the CMS is complete.

You should also check within SQL Management Studio that the primary SQL Server is Principal for all of the databases, the CMS and LIS databases will also reside on this Server. Once this is set-up you can run the following cmdlet.

Install-CsMirrorDatabase -DatabaseType Centralmgmt -FileShare \\{server FQDN}\MirrorBackup -SqlServerFqdn {SQL Server FQDN}

Note: the –databasepaths switch is not used with the Install-CsMirrorDatabase comdlet, but you should make sure that both the Principal and Mirror SQL Servers in the DR site have the exact drive structure. The databases and logs will be created on the same LUNs and within the same directories taken from the Principal.

Once complete you can check the mirror state using the Get-CsDatabaseMirrorState -PoolFqdn {Pool FQDN in the DR site}. You will have to run Setup on all FE’s in the backup Pool within the DR site. Once complete you should also make sure the Master Replicator and File Transfer Agents Services are started on all Front-Ends within the DR site and if not start them.

For final checks use the Get-CsBackupServiceStatus -PoolFqdn {Pool FQDN} on both the Primary and Backup Pools. You can also make a final check on replications after some time using the Get-CsManagementStoreReplicationStatus cmdlet. This should return TRUE for all Servers.

“Real World”

On a recent customer visit I went through this with my customer and hit the following interesting issue. The scenario was that the customer was moving from Lync 2013 to SfB 2015. Part of the process was to also move the OS version to Windows 2012 to 2012 R2 and the SQL version from SQL Server 2012 to 2014, so we completed a side-by-side upgrade.

The Lync 2013 Pool we were moving the CMs from and the SfB 2015 Pool which was the destination were both mirrored. The move of the CMS was completed successfully between Pools, but we hit a problem when trying to mirror the CMS once it had been moved to SfB 2015.

4

When we had run the Install-CsMirrorDatabase cmdlet for some reason the Witness which was used in the Lync 2013 deployment was showing. This was the reason it was failing because the Witness was SQL 2012 whereas the two new SQL Servers were SQL 2014. When we looked within topology builder the SQL Server Store had two references associated with it. The new database store and the old Witness from Lync 2013, even though when looking in the topology there was nothing referencing the old Witness Server within the new Pool environment.

5

The fix actually turned out to be quite easy, we simply had to click on the dropdown within the topology builder where the new Witness was choosing something else and then choose the Witness again, the re-publish. At this point the Server did want to try and mirror again, but failed due to mirroring being in place already for databases apart from the CMS. The actually text file advising what was to be completed next after publishing was mis-leading it asked us to run the Uninstall-CsMirrowDatabase for the database when actually what we needed to do was to run Install-CsMirrorDatabase for the CMS management database (as detailed above). Once we had run the above command again the correct Witness was picked up and the CMS was mirrored correctly.

When we tried the same procedure on the DR site, simply publishing the topology was enough to mirror the CMS on the SQL Servers within the DR site. I am not sure why this was the case perhaps it was because the CMS was actually active on the primary site. However, looking within the topology show both Pools (Primary and Backup) within the CMS section with the primary being active.

High Level Steps (for completeness the information contains Part 1 and Part 2 steps)

  1. Backup CMS
    1. Export-CsConfiguration –filename c:\{path}\cmsconfig.zip
    2. Export-CsLISconfiguration –filename c:\{path}\lis.zip
  2. Create CMS database on the SQL Server you are moving to
    1. Install-CsDatabase –CentralManagementDatabase –SQLServerFQDN {SQL Server FQDN} –DatabasePaths “E:\”, “D:\”
    2. Check Db’s and log files are created in both SQL and the disk
    3. Enable-CsTopology and correct any errors
  3. Check replication and make sure all replicas are “True” and up to date
    1. Get-CsManagementStoreReplicationStatus
  4. Move CMS
    1. Check the SQL Server we are moving the CMS to is the principal for all current databases
    2. Move-CsManagementServer and check details are correct then type A
    3. You may need to start / re-start both the Master Replica and File Transfer Agent services on the Front-End used for the move
    4. Run setup on all the old Lync 2013 FE’s and the new SfB 2015 FE’s, (this should be run again if the Master Replica and File Transfer Agent services still appear on the Lync 2013 Servers or do not appear on the SfB 2015 Servers)
    5. Re-boot all SfB 2015 Front End’s one at a time in turn checking replication before each one is re-booted
  5. Check replication and the move
    1. Get-CsManagementStoreReplicationStatus
    2. Get-CsManagementConnection
    3. Get-CsService –CentralManagement
    4. Get-CsManagementStoreReplicationStatus after sometime and validate replication is completed and appears as True
  6. Install CMS on Mirror database of the SQL in the SfB Pool you are moving to (if required)
    1. Install-CsMirrorDatabase –DatabaseType CentralMgmt -FileShare "\\{Server FQDN}\{share}" -SqlServerFqdn {“SQL Server FQDN}"}
  7. Install CMS on Paired Pool of the Pool you are moving to (if required)
    1. Get-CsBackupServiceStatus -PoolFqdn {Pool FQDN} (you moved the CMS to this pool)
    2. Get-CsBackupServiceStatus -PoolFqdn {Pool FQDN}
    3. Check Principal and Mirror SQL servers
    4. Install-CsDatabase -CentralManagementDatabase -SQLServerFQDN {SQL FQDN} –DatabasePaths “E:\”, “D:\”
  8. Install CMS on Paired Pool Mirror in the remote paired site
    1. Install-CsMirrorDatabase -DatabaseType Centralmgmt -FileShare \\{server FQDN}\{mirrorshare} -SqlServerFqdn {Primary SQL Server FQDN}
    2. Get-CsDatabaseMirrorState -PoolFqdn {Pool FQDN}
    3. Run setup on all Front End’s in the backup Pool
    4. Start the Master Replicator and File Transfer Agents services if not started
    5. Get-CsBackupServiceStatus -PoolFqdn {Primary Pool FQDN}
    6. Get-CsBackupServiceStatus -PoolFqdn {Paired Pool FQDN}

I hope this actually has been useful for people, if you have any comments or believe the process can be more streamlined then please comment to let me know.

Author: Dave Murphy

Contributors: Tushar Pathak

I would like to thank Tushar for his valuable input into this procedure and support of the process. Tushar is a Support Escalation Engineer (SEE) working out of India. Part 1 deals with moving the CMS within a single Pool or non-DR Pool architecture.