Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by João Silva -
Number of replies: 15

Hi!

In "Environment", in Moodle 2.4.4, it is ok to migrate to Moodle 2.5. Database is in utf-8 Unicode is ok. But the migration to version 2.5 fails, reporting that the database is not in utf-8 unicode. Is this a bug in Moodle 2.5?

Attachment db.jpg
Average of ratings: -
In reply to João Silva

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In reply to Howard Miller

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by João Silva -

Thanks, but it still not working.

Attachment error.jpg
In reply to João Silva

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
What encoding does mdl_config table have?
In reply to Petr Skoda

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by João Silva -

utf8_unicode_ci

Attachment config.jpg
In reply to João Silva

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

There is a useful script that should fix things: admin/cli/mysql_collation.php

In reply to Tim Hunt

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Correct me if I'm wrong (likely!) but does the collation have anything to do with this check. Thought it was the encoding (or even the default encoding). His display isn't showing that, which doesn't help much.

In reply to Howard Miller

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by João Silva -

I think that is ok.

Attachment collation1.jpg
Attachment collation2.jpg
In reply to João Silva

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You need to find and make sure the database 'character set' is UTF8. The collation is not the character set - it is the rules for comparing strings to each other.

In reply to Howard Miller

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Database charset is irrelevant since Moodle 2.5, the deciding factor is now charset and collation of the config table.

My wild guess is that config.php and screenshot might use different databse or prefix, the only other possibility seems config table chatset trouble - please verify the charset of all text fields in the config table too.
Average of ratings: Useful (2)
In reply to Petr Skoda

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That's interesting, I'll add that to the FAQ (for when I forget)

In reply to João Silva

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

More than likely, when you made your database for Moodle 2.5 for the migration, you did not specify utf-8, so you have all your tables that migrated as utf-8, but not the database itself. Over the years I have done that myself a couple of times. 

Hope this helps,

AL

In reply to AL Rachels

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by João Silva -

Ok, thanks, but how do I convert the database via CPANEL?

In reply to João Silva

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by João Silva -

I had to go back to the previous version (2.4.3+) and the strange thing is the OK to the 2.5 version in the environment section.

 

Attachment 243.jpg
In reply to João Silva

Re: Migration 2.4.4 -> 2.5: utf-8 not installed (bug?!)

by Jaswant Tak -

Yes I guess there is a bug, it always says same message "Check database unicode" while everything database and all tables are utf8_unicode_ci

I temporary continued by changing return type to 'true' in lib/dml/mysqli_native_moodle_database.php for

function setup_is_unicodedb()

changed return $return; to return true;

But there is a bug for sure.

Thanks