summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-07-06 16:59:30 +0530
committerArun Isaac2022-07-06 16:59:30 +0530
commitfd9df26dd1b91c65e8ae79f702e9c789ad8cb5c2 (patch)
tree53927cc8baf16bf69eec93d1f8652bdc8daf07fb
parent35a6deec5c455a9d58db49f5ce8cf2150a202939 (diff)
downloadgn-gemtext-fd9df26dd1b91c65e8ae79f702e9c789ad8cb5c2.tar.gz
Document how to update penguin2 mariadb to the production database.
* topics/systems/mariadb/mariadb.gmi (Update MariaDB on penguin2 to the latest production database): New section.
-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