Requires: phpFox version >= 4.3.0

MySQL replication is a process that allows you to easily maintain multiple copies of a MySQL data by having them copied automatically from a master to a slave database. This can be helpful for many reasons including facilitating backup solution for the data,a way to analyze it without using the main database, or simply as a means to scale out.

1. Setup Master and Slaver Mysql server.

There are many tutorials to setup master and slaver mysql server. You can reference these link:

This tutorial requires advanced knowledge. We recommend you get professionals to do this if you are not at an advanced level.

2. Test connection between php server and MySQL server.

Login ssh to php server, then try to connect to Master and Slaver server

mysql -u username -h MASTER_SERVER_IP -p
mysql -u username -h SLAVER_SERVER_IP -p

If you can't connect to Master or Slaver server, you can follow this to update it.

3. Change phpFox configuration.

Update file PF.Base/file/settings/server.sett.php

$_CONF['db']['driver'] = 'mysqli'; 
$_CONF['db']['host'] = 'master_server_ip'; // host
$_CONF['db']['user'] = 'username';
$_CONF['db']['pass'] = 'pass';
$_CONF['db']['name'] = 'name';
$_CONF['db']['prefix'] = 'phpfox_';
$_CONF['db']['port'] = '3306';

$_CONF['db']['slave'] = true;
$_CONF['db']['slave_servers'] = [