Note: You are currently viewing documentation for Moodle 2.9. Up-to-date documentation for the latest stable version of Moodle may be available here: error/moodle/unicodeupgradeerror.

error/moodle/unicodeupgradeerror

From MoodleDocs

Error message:

Sorry, but your database is not already in Unicode, and this version of Moodle is not able to migrate your database to Unicode. Please upgrade to Moodle 1.7.x first and perform the Unicode migration from the Admin page. After that is done you should be able to migrate to Moodle 2007101580

The method of getting the error could have been caused by the following senario.

  1. You had a Unicode database on your old server.
  2. You backed up the content of it to a sql file using mysqldump.
  3. You created an empty database on the new server.
  4. You restored the content of the old database from your sql file to the new database.
  5. You then discovered that the new database is not Unicode like the old one was when you ran the Moodle install script, because the empty database into which you restored from the sql file was not configured as Unicode.

There are two solutions that I have found that can resolve this issue:

1. Check the variable in your config.php file:


$CFG->unicodedb = true;

2. Issue the sql statement


ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

To avoid this problem initially create the database with utf8 options. CREATE DATABASE moodle CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Here are other related links that might help: https://docs.moodle.org/en/Database_migration https://docs.moodle.org/en/Converting_files_to_UTF-8