Error upgrading from 1.9 to 2.0

Error upgrading from 1.9 to 2.0

by Easwari Thoreraj -
Number of replies: 2

I am in the process of upgrading from moodle 1.9.3 to 2.0.9+. Everything seemed to go smoothly at first then I get this error:

Debug info: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='
SELECT DISTINCT c.id AS courseid, ra.enrol, c.timecreated, c.timemodified
FROM mdl_course c
JOIN mdl_context ctx ON (ctx.instanceid = c.id AND ctx.contextlevel = 50)
JOIN mdl_role_assignments ra ON (ra.contextid = ctx.id AND ra.enrol <> '')
LEFT JOIN mdl_enrol e ON (e.courseid = c.id AND e.enrol = ra.enrol)
WHERE c.id <> ? AND e.id IS NULL
[array (
0 => '1',
)]
Stack trace:
  • line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 768 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 4093 of /lib/db/upgrade.php: call to mysqli_native_moodle_database->get_recordset_sql()
  • line 1393 of /lib/upgradelib.php: call to xmldb_main_upgrade()
  • line 273 of /admin/index.php: call to upgrade_core()

 

I would appreciate some directions to resolve this issue. Thank you.

E

Average of ratings: -
In reply to Easwari Thoreraj

Re: Error upgrading from 1.9 to 2.0

by Guillermo Madero -

Hi Easwari,

Please read the following thread:

http://moodle.org/mod/forum/discuss.php?d=199971

and the following page:

http://docs.moodle.org/22/en/Converting_your_MySQL_database_to_UTF8#Converting_a_database_containing_tables

Please notice that while you can use either unicode or general:

"utf8_unicode_ci" is more precise, but it works a bit slower, so "utf8_general_ci" tends to be the preferred collation.

In reply to Guillermo Madero

Re: Error upgrading from 1.9 to 2.0

by Easwari Thoreraj -

Thank you for the links and it looks like those links contain sql query examples that should convert the affected columns to the right character sets. I'll try them and hope all will be good after this.

Your help is much appreciated!
Easwari