Support

Akeeba Backup for Joomla!

#40425 Restore error from MySQL 8 to MariaDB for utf8mb4_0900_ai_ci'

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Backup version
9.8.5

Latest post by RobertG on Monday, 11 March 2024 10:51 CDT

RobertG

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 10MiB, please upload it on your server and post a link to it.

Hi Nicholas,

I restored a Joomla! 3 site on a MySQL 8.3 database on my local Wampserver server, in order to prepare it for migration to version 4.4.3.

The upgrade didn't work locally. So I transferred a full backup to my remote server, which uses MariaDB databases, but when I imported the tables, the restore failed on the 'utf8mb4_0900_ai_ci' collation that MySQL 8 had assigned to the 'finder' tables. When I then tested the local transfer of the tables to a MariaDB database, I got an error #1273 - Unknown collation: 'utf8mb4_0900_ai_ci'.

I had to modify the collation in a backup made with phpMyAdmin on my local server to import it into a MariaDB database and configure the site to use this MariaDB database to redo an Akeeba backup and restore it on my remote server.

Would Angie be able to manage this difference in collation? I'm thinking of users who would change host and whose database server would no longer be MySQL 8 but MariaDB.

Thanks!

Regards,

Robert

 

nicholas
Akeeba Staff
Manager

Something does not add up.

You are asking for help with Akeeba Backup 9 which only works on Joomla! 4 and 5. However, you explicitly mention Joomla! 3.

One of these pieces of conflicting information is wrong. I need to know which exact version of Joomla! and Akeeba Backup you are using to take your backup, as this will change my reply.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

RobertG

Sorry Nicholas, I used Akeeba 8.3.3! to backup a J3 local site and then restore it on my remote server.

RobertG

To recap:
- I restored a local backup of a Joomla 3.10.12 site on a MySQL 8 database
- I wasn't able to migrate to version 4 because the database structure update was blocked
- I transferred the backup to my remote server which uses MariaDB (and where I have sites from versions 3 to 5)
- restoring the database was blocked by the collation error

nicholas
Akeeba Staff
Manager

OK, so the problem is with restoring the Joomla! 3 site. In this case, the applicable version of Akeeba Backup is probably 8 something. It would be great if I knew exactly which version, but we might be able to work without this knowledge. I will assume you are using 8.3.3. If not, remember to install Akeeba Backup 8.3.3 and take a backup with it before proceeding.

After extracting the backup archive and before clicking on the "Run the Installer" open the file installation/framework/database/restore/mysqli.php. Around line 154 you will see the following code:

		if (is_null($MySQL8))
{
$MySQL8 = version_compare($this->db->getVersion(), '7.999.999', 'ge');
}

Add a line after it so now it reads:

		if (is_null($MySQL8))
{
$MySQL8 = version_compare($this->db->getVersion(), '7.999.999', 'ge');
}
$downgradeUtf8 = false; $MySQL55 = false; $MySQL8 = false;

I highlighted the added line in bold type. This causes the if-block further down (lines 310 to 341) to fall through to the last case which replaces the utf8mb4_0900_ai_ci collation with utf8mb4_unicode_520_ci. The latter is supported by MariaDB, it just lacks support for some extended characters added in Unicode specifications 6 and later, such as some Emoji.

Save the file, and go back to Kickstart. Click on Run the Installer and proceed with the restoration as normal.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

RobertG

Thanks Nicholas, but I've already solved the problem by making a replacement in the SQL export text of the MySQL 8.8 database, imported this SQL into a local MariaDB 11.3.2 database, used this database with the local site before making a backup which I was finally able to restore on my remote server.

(Sorry, I don't know why the text is so small!)

Regards,
Robert

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!