Databases: How do I migrate the database to UTF-8 exactly

Databases: How do I migrate the database to UTF-8 exactly

by Jack Huang -
Number of replies: 4
How do I migrate the database to UTF-8 exactly? I'm sorry, I know everyone is talking about it, but I couldn't find anywhere, where is "migration button"? I upgraded from 1.6 to 1.8, but in administration page, I just couldn't find the "migration button"?
Thanks
Average of ratings: -
In reply to Jack Huang

Re: Databases: How do I migrate the database to UTF-8 exactly

by Tim Hunt -
Immàgine de Core developers Immàgine de Documentation writers Immàgine de Particularly helpful Moodlers Immàgine de Peer reviewers Immàgine de Plugin developers
1.8 is already UTF-8. Migration is only relevant if you originally started with 1.5 or earliers and then upgraded from there.
In reply to Tim Hunt

回复: Re: How do I migrate the database to UTF-8 exactly

by Jack Huang -
But when I go to ADMIN>SERVER>ENVIRONMENT, I still see

unicode
is required to be installed/enabled. Check

Even though it does seem that it's UTF-8 now, because I have a multi-language site, and multi-language can show on one page with no problem, not sure if that UTF-8 supposed to be.

Please Advise.
Thanks
In reply to Jack Huang

Re: Databases: How do I migrate the database to UTF-8 exactly

by Samuli Karevaara -
Moodle's code for that notice checks (in MySQL) for "character_set_database" system variable. This means that even if all of the Moodle tables have a UTF-8 charset and the data is coded in UTF-8, this notice appears if the database has a default charset that's not UTF-8.

I got rid of this notice with the following SQL query:
ALTER DATABASE your_moodle_db_name
 DEFAULT CHARACTER SET utf8
 DEFAULT COLLATE utf8_unicode_ci

You can read more at http://dev.mysql.com/doc/refman/5.0/en/charset-database.html.

Average of ratings:Useful (2)