summaryrefslogtreecommitdiff
path: root/topics/systems/mariadb/mariadb.gmi
diff options
context:
space:
mode:
Diffstat (limited to 'topics/systems/mariadb/mariadb.gmi')
-rw-r--r--topics/systems/mariadb/mariadb.gmi21
1 files changed, 21 insertions, 0 deletions
diff --git a/topics/systems/mariadb/mariadb.gmi b/topics/systems/mariadb/mariadb.gmi
index 0cbd0e7..56661b6 100644
--- a/topics/systems/mariadb/mariadb.gmi
+++ b/topics/systems/mariadb/mariadb.gmi
@@ -34,3 +34,24 @@ To get a log with some stuff filtered out try
```
mysql -p -u webqtlout db_webqtl -e "SHOW BINLOG EVENTS IN 'gn0-binary-log.000014';" -r -s |grep -v -e "Access\|GTID\|INSERT_ID\|COMMIT\|Temp\|lastlogin\|LITERA\|flush\|ROLLBACK"
```
+
+## Update MariaDB on penguin2 to the latest production database
+
+The MariaDB instance running on penguin2 needs to be periodically updated to the latest version of the database running on production. We do this by restoring backups of the production database stored on penguin2 into the penguin2 MariaDB database directory. Here's how.
+
+Backups are managed using Borg as the ibackup user. First, become the ibackup user.
+```
+me@penguin2$ sudo -su ibackup
+```
+Borg expects the passphrase in an environment variable. Set it by sourcing this shell script.
+```
+ibackup@penguin2$ . /home/ibackup/.borg-pass
+```
+Change directory to /export/backup/tux01 and list the backup archives.
+```
+ibackup@penguin2:/export/backup/tux01$ /home/wrk/opt/borg/bin/borg list borg-tux01/
+```
+Stop the running mariadb-guix.service. Restore the latest backup archive and overwrite the existing database directory at /var/lib/mysql. Finally, restart the service. Note that /var/lib/mysql is actually a symbolic link to the real database directory at /export/mysql.
+
+=> https://www.borgbackup.org/ Borg
+=> https://borgbackup.readthedocs.io/en/stable/ Borg documentation