... | @@ -30,7 +30,7 @@ We at OPL use `docker-compose` both for provisioning our development machines as |
... | @@ -30,7 +30,7 @@ We at OPL use `docker-compose` both for provisioning our development machines as |
|
|
|
|
|
### Backup & restore
|
|
### Backup & restore
|
|
|
|
|
|
There are two databases that are vital for the systems integrity. They contain the "source of truth" for the state in the system: *MySQL* holds all the patrons, items and ciruclation data, and *Fuseki* is master for the knowledge graph representing the catalog and related metadata. Needless to say, backups of those should be performed regularly and stored in a safe place.
|
|
There are two databases that are vital for the systems integrity. They contain the "source of truth" for the state in the system: **MySQL** holds all the patrons, items and ciruclation data, and **Fuseki** is master for the knowledge graph representing the catalog and related metadata. Needless to say, backups of those should be performed regularly and stored in a safe place.
|
|
|
|
|
|
All databases in the system use docker volumes to persist data.
|
|
All databases in the system use docker volumes to persist data.
|
|
|
|
|
... | @@ -38,7 +38,10 @@ All databases in the system use docker volumes to persist data. |
... | @@ -38,7 +38,10 @@ All databases in the system use docker volumes to persist data. |
|
|
|
|
|
Normally, we take backups by simply copying the datavolume, but in the case of MySQL, we found there is a risk of getting a corrupted backup, probably due to the large number of writes happening at any time. So to get a safe snapshot of the DB use mysqldump:
|
|
Normally, we take backups by simply copying the datavolume, but in the case of MySQL, we found there is a risk of getting a corrupted backup, probably due to the large number of writes happening at any time. So to get a safe snapshot of the DB use mysqldump:
|
|
|
|
|
|
docker exec -i koha_mysql_slave bash -c 'mysqldump -uroot -p$MYSQL_PASSWORD $MYSQL_DATABASE --single-transaction --master-data=2 --flush-logs --routines --triggers --events --hex-blob' > /data/dumps/`date +%F`/koha_mysqldump_full.sql
|
|
docker exec -i koha_mysql_slave bash -c \
|
|
|
|
'mysqldump -uroot -p$MYSQL_PASSWORD $MYSQL_DATABASE \
|
|
|
|
--single-transaction --master-data=2 --flush-logs --routines --triggers --events --hex-blob' \
|
|
|
|
> /data/dumps/`date +%F`/koha_mysqldump_full.sql
|
|
|
|
|
|
At OPL we are running the backup against a read-only slave, as not to create additional burden on the master DB.
|
|
At OPL we are running the backup against a read-only slave, as not to create additional burden on the master DB.
|
|
|
|
|
... | | ... | |