The MariaDB server houses MariaDB (used for NCLEX applications) and PostgreSQL (used by Canvas)
apt -y install mariadb-server
systemctl enable --now mariadb
Edit the server config (/etc/mysql/mariadb.conf.d/50-server.cnf) to allow MariaDB to listen on all ports.
Set the password for root@localhost, and input it into /root/.my.cnf [client] section.
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update -y
apt-get install postgresql-14 -y
systemctl enable --now postgresql
Edit the server config (/etc/postgresql/14/main/pg_hba.conf) to allow Postgres to listen on all ports.
Daily backups occur every 8 hours.
Daily backups are retained for 30 days
Weekly backups are retained for 35 weeks
Monthly backups are retained indefinitely.
Backups are run by automysqlbackup via cron to /backups:
/usr/local/bin/automysqlbackup
To restore a backup, here is an example using NCLEX2 to database NCLEX2_restore:
1. Go to /backups/daily/NCLEX2
2. Extract the backup
gnuzip daily_NCLEX2_2025-01-10_18h45m_Friday.sql.gz
3. Restore the database:
mysql NCLEX2_restore < daily_NCLEX2_2025-01-10_18h45m_Friday.sql
Backups for postgresql are run via a script in /root/backup_postgres.sh
To restore a backup, here is an example for canvas:
1. Switch to the postgres user
su - postgres
2. Restore the backup
psql canvas < /backups/postgres/canvas_backup_20250110_191515.sql