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.
- Run
yum update
andyum upgrade
to install the latest updates. - Reboot:
shutdown -r now
- After your server completes these commands run the following setup script from MariaDB: `
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
- Stop the MariaDB service:
systemctl stop mariadb.service
- Remove the old version of MariaDB:
yum remove mariadb-server
- Install the latest version and associated tools:
yum install MariaDB-server galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common
- Enable the service and start MariaDB:
systemctl enable mariadb.service
&&
systemctl start mariadb.service
- 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!