How to upgrade mariadb 5.5 to mariadb 10 on centos 7.9?

How to upgrade mariadb 5.5 to mariadb 10 on centos 7.9?
my php is 5.6 and current mysql/mariadb is 5.5.
Is there a save way without downtime to do this?

I used the SCL on the one system I absolutely needed a newer mariadb on:

I tend to recommend SCL packages over most other third party repos, as it follows guidelines that make it a little more predictable. You still have to make a few changes, and will need to proceed with caution (I recommend backing up your database with both an SQL dump and a binary backup of the /var/lib/mysql directory while mariadb is stopped). I seem to recall MariaDB 10 can upgrade itself from 5 without a dump/restore, but no reason to take any chances. It’s been so long since I did the migration I don’t remember specifics.

This is probably incomplete, but at least a few of the necessary steps:

  1. Make your SQL dump back up of all databases. Virtualmin domain backups will contain a dump of the databases, as well, so if you’ve already got backups setup, you can just trigger that, if you don’t know how or don’t want to do just a database dump for all databases.
  2. Stop the old mariadb and disable it. systemctl stop mariadb; systemctl disable mariadb. Probably ought to mask it, too, so you don’t accidentally start it. Don’t uninstall it yet, even if you plan to uninstall it later after everything is confirmed working.
  3. Make your backup of the /var/lib/mysql directory.
  4. Install the new mariadb version from SCL.
  5. Start it, I think? systemctl start rh-mariadb103-mariadb. You may need to confirm it’s using the /etc/my.cnf configuration instead of one in /opt/rh-mariadb-103. I don’t remember if I changed this or it was the default.
  6. Test it, or check for errors when starting. Pretty sure I didn’t need to do a dump/restore to get my mariadb 5.5 database into 10, but maybe read up on upgrading from 5.5. to 10.x before embarking on this. I’m not a database expert.
  7. Update the Webmin MySQL module to call the right services when stop/start/restarting. This is in the Module Configuration for the MySQL module (gear icon). Service name is the rh-mariadb103-mariadb thing (or similar, depending on which version you use).
  8. Test Webmin and Virtualmin to make sure they’re doing the right things when creating and modifying domains and installing scripts.
  9. Celebrate, maybe?

I can’t stress enough that you need backups before doing this, and you need to read up on what the mariadb people say about upgrades.

This is mostly a problem unrelated to Virtualmin, and you should rely on the people who know things about MariaDB to guide you rather than people who know things about Virtualmin. They have upgrade docs…those are your primary source. I’m just reporting what I think I did to migrate that one time a couple years ago.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.