Log shipping

Log shipping is the process of automating the backup of a database and transaction log files on a primary (production) database server, and then restoring them onto a standby server.

What is the log shipping?

The log shipping is a technique to replicate database to another database instance by copying and reload a transaction log file.
In the case of EPPO, the process of transferring the transaction log files is made through webservices.
As the process result there are two copies of the data on two separate locations.

A log shipping session involves the following steps:

Initialization for PostgreSQL Database
# createdb -h -E UTF8 -U postgres DBEPPOreplica
# psql  -h -U postgres --single-transaction -q  DBEPPOreplica <  pg_structure.sql
# psql  -h -U postgres --single-transaction -q  DBEPPOreplica <  init_logshipping.sql


Initialization for MySQL Database
# mysqladmin --user=root --password=mypassword create dbepporeplica
# mysql dbepporeplica --user=root --password= mypassword --batch --default-character-set=UTF8 < mysql_structure.sql
# mysql dbepporeplica --user=root --password= mypassword --batch --default-character-set=UTF8 < init_logshipping.sql

Configure script
Into script you have to change 2 parameters
define('AUTHTOKEN', 'xxxxxxxxxxxxxxxxxxxxxx');
the token is needed and can be created online on https://data.eppo.int


Execution of the script
# php client_mysql_v1.php

For postgresql
# php client_pg_v1.php