Database upgrade issue

Hope this is in the right place.

So I’ve been having an issue that has been going on for some time now and unfortunately I put off doing something about it for so long that I’ve painted myself into a corner and need some help. The problem is I have a few jails on my TureNAS core box that I run that have databases that won’t upgrade. Everything I’ve tried fails. The biggest issue I’m having is that 2 of the jails are still running mysql 5.6 and there is no direct upgrade path to either mysql 8.0 or Mariadb 10.5. Those specific versions of each database are the oldest versions of each that are available in the repo. I’ve also got 2 jails that are running mariadb 10.3 and both of those fail when attempting to upgrade to 10.5 and that should be a straight forward and supported upgrade.

I’ve tried both upgrading directly by installing the newer versions in each jail followed by mysql-upgrade/mariadb-upgrade and that fails. I’ve also used mysql-dump to create a backup and then installing the new versions and restoring the database dump. That also fails. I even spun up a fresh jail to test in and trying to load a database backup there fails as well.

I don’t know how to move forward from here. I’ve got to get these database upgrades solved so that I can move the applications off Core for the inevitable switch to Scale. I really don’t want to lose these apps especially since one of them is a small private discussion forum I’ve been hosting for nearly 10 years.

Is anyone out there good with databases and can lend a hand here or at least point me in the right direction? Hoping that @pmh sees this…

Small update. I managed to get the 2 instances of Mariadb upgraded from 10.3 to 10.5. For whatever reason in the database connection settings for each app had to be changed from ‘localhost’ to ‘127.0.0.1’. Not sure why they worked before but not after the database upgrade.

Now to see if I can get the 2 jails running mysql 5.6 to upgrade to Mariadb 10.5. The documentation states that you have to update to mysql 5.7 first before you attempt the upgrade. Since this is not a direct upgrade path I’m not too optimistic that it will work.

If I could just find an old tarball of the mysql 5.7 package this would be a lot easier.

Got it all taken care and it went better than I thought it would. This topic can be closed or even deleted since it’s not a TrueNAS issue at all.

2 Likes

Glad you were able to fix it yourself.

On the way from MariaDB 10.3 to 10.5, 10.6, 10.11, … a larger restructuring of the MariaDB ports took place.

The location of the Unix domain socket changed from /tmp/mysql.sock to /var/run/mysql/mysql.sock. This combined with the MariaDB/MySQL magic feature to interpret “localhost” as “use a Unix domain socket instead of TCP to 127.0.0.1” lead to one of your failures.

Second the config files, too, were restructured from a single file in /usr/local/etc/my.cnf to separate client and server files in the /usr/local/etc/mysql directory.

Which probably explains all of your problems with in-place upgrades. Analysing the error messages and adjusting one by one is the only method I know of :wink:

Kind regards,
Patrick

2 Likes