Topic Last Modified: 2014-03-14

If you have configured your back-end database to use synchronized mirroring with a witness, failover is automatic. If you have configured synchronized mirroring without a witness, you can use the following procedures to failover and failback your database. You can also use these procedures to manually failover and failback your databases even if you have configured a witness.

To fail over your back-end database

  1. Before failing over, determine which back-end database is the principal and which is the mirror by typing the following cmdlet:

    Copy Code
    Get-CsDatabaseMirrorState -PoolFqdn <poolFQDN> -DatabaseType User
    
  2. If the Central Management store is hosted in this pool, type the following cmdlet to determine which is the principal and which is the mirror for the Central Management store:

    Copy Code
    Get-CsDatabaseMirrorState -PoolFqdn <poolFQDN> -DatabaseType CentralMgmt
    
  3. Perform the failover of the user database:

    • If the primary has failed and you are failing over to the mirror, type:

      Copy Code
      Invoke-CsDatabaseFailover -PoolFqdn <poolFQDN> -DatabaseType User -NewPrincipal mirror -Verbose
      
    • If the mirror has failed and you are failing over to the primary, type:

      Copy Code
      Invoke-CsDatabaseFailover -PoolFqdn <poolFQDN> -DatabaseType User -NewPrincipal primary -Verbose
      
  4. If the pool hosts the Central Management Server, perform the failover of the Central Management store.

    • If the primary has failed and you are failing over to the mirror, type:

      Copy Code
      Invoke-CsDatabaseFailover -PoolFqdn <poolFQDN> -DatabaseType CentralMgmt -NewPrincipal mirror -Verbose
      
    • If the mirror has failed and you are failing over to the primary, type:

      Copy Code
      Invoke-CsDatabaseFailover -PoolFqdn <poolFQDN> -DatabaseType CentralMgmt -NewPrincipal primary -Verbose