• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Update MariaDB from 10.4.32 to 10.5

NITROFOX

Basic Pleskian
Server operating system version
AlmaLinux 8.8
Plesk version and microupdate number
18.0.56
Hi all,

I recently upgraded the old version from 10.3 to 10.4.32, and now I wanted to do the rest of the updates, starting with 10.5, but I'm getting the following error:

If you can help me, I would appreciate it.


yum install MariaDB-server galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common
Upgrading directly from MySQL 10.4 to MariaDB 10.5 may not
be safe in all cases. A manual dump and restore using mysqldump is
recommended. It is important to review the MariaDB manual's Upgrading
section for version-specific incompatibilities.

A manual upgrade is required.

- Ensure that you have a complete, working backup of your data and my.cnf
files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages. Usually this command will
list the packages you should remove:
rpm -qa | grep -i '^mysql-'

You may choose to use 'rpm --nodeps -ev <package-name>' to remove
the package which contains the mysqlclient shared library. The
library will be reinstalled by the MariaDB-shared package.
- Install the new MariaDB packages supplied by MariaDB Foundation
- Ensure that the MariaDB server is started
- Run the 'mysql_upgrade' program

This is a brief description of the upgrade process. Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
error: %prein(MariaDB-server-10.5.23-1.el8.x86_64) scriptlet failed, exit status 1

Error in PREIN scriptlet in rpm package MariaDB-server
Running scriptlet: MariaDB-backup-10.5.23-1.el8.x86_64 5/10
error: MariaDB-server-10.5.23-1.el8.x86_64: install failed

Upgrading : MariaDB-backup-10.5.23-1.el8.x86_64 5/10
Running scriptlet: MariaDB-backup-10.5.23-1.el8.x86_64 5/10
Running scriptlet: MariaDB-client-10.4.32-1.el8.x86_64 6/10
error: MariaDB-server-10.4.32-1.el8.x86_64: erase skipped

Cleanup : MariaDB-client-10.4.32-1.el8.x86_64 6/10
Running scriptlet: MariaDB-client-10.4.32-1.el8.x86_64 6/10
Running scriptlet: MariaDB-backup-10.4.32-1.el8.x86_64 7/10
Cleanup : MariaDB-backup-10.4.32-1.el8.x86_64 7/10
Running scriptlet: MariaDB-backup-10.4.32-1.el8.x86_64 7/10
Running scriptlet: MariaDB-common-10.4.32-1.el8.x86_64 8/10
Cleanup : MariaDB-common-10.4.32-1.el8.x86_64 8/10
Running scriptlet: MariaDB-common-10.4.32-1.el8.x86_64 8/10
Running scriptlet: MariaDB-shared-10.4.32-1.el8.x86_64 9/10
Cleanup : MariaDB-shared-10.4.32-1.el8.x86_64 9/10
Running scriptlet: MariaDB-shared-10.4.32-1.el8.x86_64 9/10
Running scriptlet: MariaDB-shared-10.5.23-1.el8.x86_64 9/10
Running scriptlet: MariaDB-common-10.5.23-1.el8.x86_64 9/10
Running scriptlet: MariaDB-client-10.5.23-1.el8.x86_64 9/10
Running scriptlet: MariaDB-backup-10.5.23-1.el8.x86_64 9/10
Running scriptlet: MariaDB-shared-10.4.32-1.el8.x86_64 9/10
Verifying : MariaDB-backup-10.5.23-1.el8.x86_64 1/10
Verifying : MariaDB-backup-10.4.32-1.el8.x86_64 2/10
Verifying : MariaDB-client-10.5.23-1.el8.x86_64 3/10
Verifying : MariaDB-client-10.4.32-1.el8.x86_64 4/10
Verifying : MariaDB-common-10.5.23-1.el8.x86_64 5/10
Verifying : MariaDB-common-10.4.32-1.el8.x86_64 6/10
Verifying : MariaDB-server-10.5.23-1.el8.x86_64 7/10
Verifying : MariaDB-server-10.4.32-1.el8.x86_64 8/10
Verifying : MariaDB-shared-10.5.23-1.el8.x86_64 9/10
Verifying : MariaDB-shared-10.4.32-1.el8.x86_64 10/10

Upgraded:
MariaDB-backup-10.5.23-1.el8.x86_64 MariaDB-client-10.5.23-1.el8.x86_64
MariaDB-common-10.5.23-1.el8.x86_64 MariaDB-shared-10.5.23-1.el8.x86_64
Failed:
MariaDB-server-10.4.32-1.el8.x86_64 MariaDB-server-10.5.23-1.el8.x86_64

Error: Transaction failed
 
I went back to 10.4, but during the upgrade to 10.5 I updated the my.cnf file unintentionally during the process and now in plesk the server does not enter, gives error:

The database server was updated with error: The test of the connection to the database server failed: SQLSTATE[HY000]: General error: 1273 Unknown collation: 'UTF8_GENERAL_CI'.


"In case upgrading to MariaDB 10.6 or newer it is needed to adjust the my.cnf configuration file to match the new requirements:"
"sed -i 's/bind-address = ::ffff:127.0.0.1/bind-address = 127.0.0.1/g' /etc/my.cnf"

I don't have my.cnf backup and I don't know how to fix it either.
 
I've been testing again and found that for some reason I had 10.6 installed, so I had to remove MariaDB 10.6 -server,client,shared,backup,common.

After uninstall, I installed mariadb 10.4 again.

Problem, my Plesk panel stopped working and it seems that mysql too, my sites are all online and maria db 10.4 working.
Server Error

500 PleskFatalException​

Can not to read /usr/local/psa/admin/htdocs/locales/default file.
TypePleskFatalException
MessageCan not to read /usr/local/psa/admin/htdocs/locales/default file.
Filecommon_func.php
Line483

I confirmed that the file "/usr/local/psa/admin/htdocs/locales/default file" no longer exists, it seems that I lost files from plesk, I don't know how I can recover or reinstall this, what commands should I use.
Commands "plesk" not working,

-bash: /usr/sbin/plesk: No such file or directory


mysql -V
mysql Ver 15.1 Distrib 10.4.32-MariaDB, for Linux (x86_64) using readline 5.1
 

Attachments

  • plesk.jpg
    plesk.jpg
    121.6 KB · Views: 8
I fix plesk and back to MariaDb 10.4

But problem continue when try update to MariaDb 10.5

Upgraded:
MariaDB-backup-10.5.23-1.el8.x86_64 MariaDB-client-10.5.23-1.el8.x86_64
MariaDB-common-10.5.23-1.el8.x86_64 MariaDB-shared-10.5.23-1.el8.x86_64
Failed:
MariaDB-server-10.4.32-1.el8.x86_64 MariaDB-server-10.5.23-1.el8.x86_64

Error: Transaction failed
 
Did you follow the steps for MariaDB upgrades mentioned in https://support.plesk.com/hc/en-us/...5-to-5-6-5-7-or-MariaDB-5-5-to-10-x-on-Linux- ? It is important to remove the existing server and client before installing the new version.

Yes, but in instructions say only remove the server, no client "yum remove mariadb-gssapi-server"

Instead of upgrading to MariaDB 10.5, consider upgrading to an LTS (Long Term Support) version, like MariaDB 10.6 or 10.11. That will give you longer support for security updates and bugfixes:


Yes, but according to the instructions, it is not advisable to upgrade directly to such a new version, but first 10.4 to 10.5 and then 10.5 to 10.6.
 
You can upgrade directly from MariaDB 10.3 to 10.6. You need to take the extra step if you have an old version of MariaDB, like 5.5 or 5.7.
 
You can upgrade directly from MariaDB 10.3 to 10.6. You need to take the extra step if you have an old version of MariaDB, like 5.5 or 5.7.

I'm on 10.4 now, I don't think I can do that anymore.

Problem with removing MariaDb entirely, giving remove server, client, etc command is that it ends up deleting files from the plesk panel. And I don't even know how to backup the plesk dashboard files, because of that before as I informed you above, I lost everything before and had to reinstall the panel and fix many errors.
 
I saw this answer today, I don't know if I can trust these commands to update:


ran into the "A manual upgrade is required." issue too, going from MariaDB 10.6 to 10.11.


This helped me:


MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin --verbose --all-databases --routines --triggers > /tmp/all-databases.sql
systemctl stop mariadb
cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
rpm -q --whatprovides mysql-server
rpm -e --nodeps `rpm -q --whatprovides mysql-server`


This removes the old MariaDB without removing dependencies and then the upgrade succeeds.


@Plesk support: this should be added to the manual. Currently it isn't correct.


P.S. I'm on Almalinux 8.

I think it's valid from 10.4 to 10.5 as well, is it safe to run those commands?
 
OVH doesn't want to help, and Plesk support says the only solution is to force the update, but it requires a system backup because it can corrupt everything, and I don't even know how to make a full system (server) backup.

Honestly, I followed the official guide and stayed with the server in this state, and no one is responsible.
 
This is what Plesk said via OVH Support:

"All issues are coming from the fact that there is a mix of MariaDB packages.
MariaDB-Server is 10.4 version, while MariaDB-Client and libraries are from 10.5:

# rpm -qa | grep -i maria
MariaDB-server-10.4.32-1.el8.x86_64
MariaDB-common-10.5.23-1.el8.x86_64
plesk-libmariadbclient-3.1-3.1.8-1centos.8.200603.1842.x86_64
MariaDB-backup-10.5.23-1.el8.x86_64
plesk-libmariadbclient-3.3-3.3.5-2.redhat.8+p18.0.57.0+t231012.0710.x86_64
MariaDB-client-10.5.23-1.el8.x86_64
MariaDB-shared-10.5.23-1.el8.x86_64
In such situation, in order to avoid any further inconsistency, the best way would be to restore a server snapshot with original 10.3 version."

Does your client have such snapshot?"

"Downgrading of MariaDB is not the best option as it is not officially supported by MariaDB and can cause further issues with databases in case they were upgraded to a higher version.
Instead we could try completing MariaDB upgrade to 10.5 to make all packages consistent.
Before we proceed I would like to ask you to make a server snapshot. Database server upgrade is not something managed by Plesk and there is always a risk. So if something goes wrong you could revert server to its current state.
Also, during upgrade database server will be inaccessible. It would be great if you could clarify with your client time-frame when we can perform it in order to minimize the impact (e.g. during server hight time)."
 
The above referenced KB article mentions how to backup the data without actually using a script. For example:

1702573115570.png
 
Plesk has released a new tool for the update that might solve my problem, but I don't know if I can use it what should I do before using it.

I've already opened the tool here and it asks for some confirmations, but I'm afraid this will go wrong, what do you advise?
 

Attachments

  • 1.jpg
    1.jpg
    138.8 KB · Views: 17
  • 2.jpg
    2.jpg
    70.7 KB · Views: 18
  • 3.jpg
    3.jpg
    115 KB · Views: 17
Back
Top