If there is a major discrepancy between two servers (eg.  Server1 is correct but Server2 is out), then sometimes the easiest way to restore the replication between them is to stop replication, delete the database of the one that is out of sync (in this example on Server2), take a snapshot of the correct database from Server1, then import it onto Server2 and restart the replication.

This needs to be done out of hours as you will need to stop the DualShield Server Service on both machines, during this process.

1) Stop the DualShied Server service on both machines.



2) On both Server1 and Server 2 machines, open a command prompt and change directory to C:\Program Files\Deepnet DualShield\mysql\bin

Log into MySQL console on both machines, and stop the slave service:

mysql -u root -p

(Enter your password at prompt)

mysql> use dualshield;

mysql> stop slave;


3) Take a snapshot of the database from the server that is correct.  In this example we will take a snapshot of Server1:

On Server1 open an elevated command prompt and change directory to C:\Program Files\Deepnet DualShield\mysql\bin

Type the command:

mysqldump -u root -p --single-transaction --opt DualShield > DualShield.sql

This will take time depending on database size and unfortunately, there is no status to show progress.

Once completed, copy the newly created 'DualShield.sql' file to the other server.  In this case we will be copying the file to Server2.  You should copy this to the same place, i.e. C:\Program Files\Deepnet DualShield\mysql\bin


4) Delete the database on Server2

Log into MySQL console and type the following command: 

mysql> drop database dualshield;

5) Create a new database on Server2

mysql> create database dualshield CHARACTER SET utf8 COLLATE utf8_general_ci;

6) Import the database you copied over from Server1.

Open an elevated command prompt and change directory to C:\Program Files\Deepnet DualShield\mysql\bin

Type the command:

mysql -u root -p DualShield < DualShield.sql

7)  Reset master and slave on both servers, and restart the slave service on both servers:

mysql> reset master; 
mysql> reset slave;
mysql> start slave;

9) Start the DualShield Server Service on both machines.


10)  Check slave status on both servers:

mysql> show slave status\G;


Make sure Slave IO and Slave SQL are both running.

  • No labels