The setup steps below are for adding a new server to daisy chain Replication when using random primary keys.
Also see: Daisy Chain Replication.
On the New Replication Server
- On the new server (location) install the MySQL application if it is not already installed.
- Download the Trial version.
- Right-click on the downloaded file and Run as administrator.
- Click Update MySQL to check the appropriate boxes.
- Make any changes if needed to data paths.
- Click Install. The installer will begin to install the MySQL Server.
- Follow the directions carefully. We recommend using the default selections.
- When you reach the MySQL Server Setup window, uncheck the Launch the MySQL Instance Configuration Wizardbox then click Finish.
- Enable Replication on the new server by setting up the my.ini file and saving it (C:\Program Files (x86)\MySQL\MySQL Server 5.5).
Add the following lines to the [mysqld] section of the my.ini file:
- Change the server-id as needed. The server ID must be unique for each replication server.
- Change the replicate-do-db to the name of the database to replicate.
- Change the relay-log value to include the name of the server you are on. ex) relay-log=ComputerName-relay-bin.
- Restart the MySQL service. On some operating systems this will require you go into the system services in Control Panel, Administrative Tools, Services and start the MySQL service manually.
Adding the New Server to the Daisy Chain
Make sure to complete each numbered step before continuing on to the next step or replication will fail. For the steps that say on all replication servers... you must perform the step on all replication servers (Primary and Replicas) before continuing on to the next step.
- Pick a database from one of the replication servers to act as the Primary. We will refer to the server where this database is located as the Primary and all other replication servers as Replica in the text below.
- On the Primary server where the database is located, log in to Open Dental. In the main menu, click Setup, Advanced Setup, Replication. Click Add to add a server. When complete, this database is ready to be replicated to others servers.
- If using Random Primary Keys, enter its primary keys as well. Follow steps 3 and 4 on Random Primary Keys.
- Install the Open Dental Replication Service on each Replica.
- On all replication servers (except the new server):
- Go the command line and navigate to the appropriate bin folder of the MySQL service. Typically C:\Program Files\MySQL\MySQL Server 5.5\bin or C:\Program Files\MariaDB 10.5\bin
Type the following: mysql -u root opendental where opendental is the name of the database. If you have a MySQL user password, add -p to the command.
- Run the following SQL statement: STOP SLAVE; (this stops the replication thread within MySQL).
- Stop the MySQL service.
- Backup and remove all files in the mysql data directory which do not reside in a subfolder, except for any files beginning with ib (e.g. iblog_file0, ib_logfile1, ibdata1).
- On all Replica servers (not the Primary or new server): Backup and remove the current replicated database (typically namedopendental) from the data directory. You must fully complete the above steps on all replication servers before proceeding or replication will fail.
- Copy the database folder on the Primary to the data directory on all Replicas and the new server.
- On all replication servers (Primary, Replicas, and new server): Repeat steps 6 - 10 from Daisy Chain Replication Setup. At this point the new server becomes a Replica.
- Install the Open Dental Replication Service on the new server(s). The service will notify all users and IT staff if replication crashes via Alerts.