How to do manual failover in AG?
Failover can be performed using
- Failover through Command. Failover command needs to be fired at Secondary Replica which has to be converted as Primary replica.
- Through Always On Availability Group Failover option and by selecting which Secondary replica to convert as Primary replica.
- Cluster Administrator (cluadmin.msc) by performing failover of AG Service.
- Login to the Node where you would want to failover and run the commands below.
alter availability group <AG-group name> failover;
alter availability group AG_Group1 failover;
ALTER AVAILABILITY GROUP <AG_Name> FORCE_FAILOVER_ALLOW_DATA_LOSS;
ALTER AVAILABILITY GROUP MyAG1 FORCE_FAILOVER_ALLOW_DATA_LOSS;