If you don't care about the database contents, it should be easy:
- Shut down the keyserver if it's running
- Uninstall MySQL:
brew services stop mysql@5.7 && brew uninstall mysql@5.7
- Delete MySQL data:
rm -rf /opt/homebrew/var/mysql/
(this directory might be different on Intel Macs) - Install and configure MariaDB by following all THREE sections in the dev environment instructions titled "MariaDB"
If you want to keep your database contents, you'll need to first back them up.
- Create a
keyserver/facts/backups.json
file- Contents:
{"enabled":true,"directory":"/home/comm/backups","maxDirSizeMiB":96}
- Change the directory to a location where you want to save the backup
- Contents:
- Update
keyserver/src/cron/cron.js
to runbackupDB
more frequently- If the current time is 15:45, you could try something like
48 * * * *
- If the current time is 15:45, you could try something like
- Run the keyserver (eg. with
yarn dev
) and wait for a backup to be generated in the directory you selected- Once the backup is finished generating, you should shut down the keyserver
- You can tell it's done once the backup file stops getting larger
- Next, follow the instructions above under "Don't care about the database contents?"
- Finally, you'll restore the database. First use
gunzip
to unarchive the backup, and then pipe it intomysql
:mysql -ucomm -Dcomm -p < ~/Downloads/backup.sql