Databases: Migration UTF-8 Problem

Databases: Migration UTF-8 Problem

by Rick Barnes -
Number of replies: 2
We have migrated our moodle and everything seems to have worked successfully and we have been running the migrated server for a few weeks now. I have jsut noticed in the environment section that although we moved a utf-8 database to the new server we are getting an error message
must be installed and enabled

It is required that you store all your data in Unicode format (UTF-8). New installations must be performed into databases that have their default character set as Unicode. If you are upgrading, you should perform the UTF-8 migration process (see the Admin page).

What did we do wrong and what do we need to do to solve this? I want to upgrade to a newer version of moodle but don't want to do anything else until we have this sorted out.


Rick

Average of ratings: -
In reply to Rick Barnes

Re: Databases: Migration UTF-8 Problem

by michael mike -

Hi I had some fun with this over the weekend. Your collation needs to be set to utf8_unicode_ci

If you are running mysql you need to ensure that every column in every table is set to utf8_unicode_ci (each column can have its own collation). In my case I had some tables in one collation as latin1_sweedish_ci and others as ut8_general_ci.  It was a mess. 

Since none of my tables contained foreign characters I simply changed the default char set, collation to utf8_unicode_ci.  Then I changed the collation for each table to utf8_unicode_ci. Then I opened each table and changed the collation for each string field to utf8_unicode_ci. About 3 hours latere I had a fully utf8_unicode_ci dbase. 

I was tricked by the 1.8 conversion. It supposedly converted my database to utf8 for me.  BaHHHHHHHHHHHHH!!!!!!!!!

Again all my characters were english thus the conversion was easy. If you have foreign characters if may not be so easy for you.

In reply to Rick Barnes

Re: Databases: Migration UTF-8 Problem

by michael mike -

Hi I had some fun with this over the weekend. Your collation needs to be set to utf8_unicode_ci

If you are running mysql you need to ensure that every column in every table is set to utf8_unicode_ci (each column can have its own collation). In my case I had some tables in one collation as latin1_sweedish_ci and others as ut8_general_ci.  It was a mess. 

Since none of my tables contained foreign characters I simply changed the default char set, collation to utf8_unicode_ci.  Then I changed the collation for each table to utf8_unicode_ci. Then I opened each table and changed the collation for each string field to utf8_unicode_ci. About 3 hours latere I had a fully utf8_unicode_ci dbase. 

I was tricked by the 1.8 conversion. It supposedly converted my database to utf8 for me.  BaHHHHHHHHHHHHH!!!!!!!!!

Again all my characters were english thus the conversion was easy. If you have foreign characters if may not be so easy for you.