Documentation
IPS_PromoteToReplicationMaster
bool IPS_PromoteToReplicationMaster ()
Returns
If the function succeeds, it returns TRUE, otherwise FALSE.
Description
This function is intended for internal use only and may change or be removed at any time without notice.
The function promotes the slave to master, so that it takes over the tasks of the master (failover). The synchronization with the master is paused, the point in time for IPS_GetReplicationFailoverTime is set and all instances in the status Standby (106) are activated. The result of the activation is logged per instance in the message log.
The same happens automatically if the automatic failover is configured and the synchronization with the master fails repeatedly. The slave can be demoted again with IPS_DemoteToReplicationSlave.
If the replication is not active, the function fails with "Replication is not active!". If the replication is not in the mode Standby (IPS_GetReplicationMode), the function fails with "Replication must be in Standby-Mode!".
Example
// Promote the slave to master manually, e.g. for a planned maintenance of the master
if (IPS_IsReplicationActive() && !IPS_IsReplicationFailoverActive()) {
IPS_PromoteToReplicationMaster();
}