Starting with Home Assistant version 2022.2, MariaDB versions older than 10.3 will be depreciated and the Home Assistant recorder will no longer connect to databases running on older versions. This post will walk you through upgrading MariaDB on CentOS.

First. Make a backup of your server and databases. I run a CentOS VM on ESXi so I simply created a snapshot of it for this work. Once you have your blackout plan ready, go ahead and SSH into your MariaDB server.

  1. Run yum update and yum upgrade to install the latest updates.
  2. Reboot: shutdown -r now
  3. After your server completes these commands run the following setup script from MariaDB: `curl -LsS | sudo bash
  4. Stop the MariaDB service: systemctl stop mariadb.service
  5. Remove the old version of MariaDB: yum remove mariadb-server
  6. Install the latest version and associated tools: yum install MariaDB-server galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common
  7. Enable the service and start MariaDB: systemctl enable mariadb.service && systemctl start mariadb.service
  8. Run the mysql_upgrade command: mysql_upgrade --user root --password

This command will check to make sure your databases are compatible with the new version of MariaDB and upgrade things as needed.  

Restart your server one more time to verify that MariaDB runs on startup and you are all finished!