Installation help

upgrading to 2.0 ERROR: System Error reading from database

Picture of Myrrh Lynn
upgrading to 2.0 ERROR: System Error reading from database

( click on my name for environment & specs)

I swear! I am about to give completely up on Moodle! This is the 4th time I have tried to upgrade from 1.9.19 to 2.0.10 and it has failed. Now I get the following error. NOW what to do? If I didn't need the pictures in the lightbox, some files in the course files and the wikis, I would just do a clean install and call it quits. Anyone got a simple fix?


Debug info: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='
SELECT DISTINCT AS courseid, ra.enrol, c.timecreated, c.timemodified
FROM mdl_course c
JOIN mdl_context ctx ON (ctx.instanceid = AND ctx.contextlevel = 50)
JOIN mdl_role_assignments ra ON (ra.contextid = AND ra.enrol <> '')
LEFT JOIN mdl_enrol e ON (e.courseid = AND e.enrol = ra.enrol)
[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()
Average of ratings: -
Picture of Ken Task
Re: upgrading to 2.0 ERROR: System Error reading from database
Group Particularly helpful Moodlers

This is really painful to watch!  Realize you are educator and not a server admin, but still painful.  Yes, I too, wish Moodle migration from 1.9 to 2.x wasn't as it is now, but that's just not the case.  It does require some research and study + some expertise or knowledge to get around/work around issues.

You've not disclosed your hosting provider, but with a little sluething see hosting provider is LIQUIDNET-HOSTING.  In searching their offerings and for their FAQ's and online customer support, see that they do offer 'one click' install of Moodle, but they do not disclose what version of Moodle and most do NOT provide scripts to upgrade - probably would do it for a fee.  About the only providers for Moodle hosting that know it well enough to do what needs to be done are Moodle Partners, but they are out of your price range.

So, the following is an attempt to address the latest issue you have (really for the benefit of others who might run into something similar):

This is a 1.9.19 migration to 2.0.highest.
There are add-ons (mods/blocks, etc. not part of core code) in the 1.9.19 site that do not have compatible versions in 2.0.x (and probably will never have them as 2.0.x is old and no longer supported).

The add-ons are recorded in the DB for the 1.9.19 and when attempting to migrate to a 2, Moodle reads those references in the DB, but cannot find them in the code for Moodle 2 - thus (missing from disk).  

The issue, however, has to do with the tables (in particular the collation).  Previous to version 2, there was no hard requirement for database engine nor collation.  There is now, however.  If you are hosted on a Linux server and have command line access, this is fixable, even if you've NOT logged on to Moodle to do the migration.  **MUST have 2.2 version of the Moodle code, however.  And the values for DB, DB user, DB password must be correct in the config.php file.**

In moodlecode/admin/cli/ there are two scripts that can only be run via command line that will: convert the DB engine and convert the collation of all tables.

cd moodlecode/admin/cli
php mysql_collation.php --collation=utf8_general_ci

while there:
php mysql_engine.php --engine=InnoDB

while there, may as well do the upgrade via command line:
php upgrade.php --non-interactive

Will upgrade the 1.9 site (actually the DB) without prompting for any information.  And, there is massive change to the moodle data directory due to the new file system in 2.   The upgrade recommendations say to work with a copy of the 1.9 site ... not the original production site.  Well, you can't do that ... due to space limitations.

Ok, the above really for a possible resolution to the reported problem for the benefit of others, now here's an offer …

I have access to servers that could be used for converting/migrating Moodle sites.  And, since you are truly education (home schooler?) … not commercial that 'does' education, I'll offer to do the conversion for FREE.  Won't do this (probably can't do this) on your server (due to lack of command line).  Won't host it for you for free, but convert/migrate it.
Then provide you with 3 zips … an sql dump, a zip of the data directory, and a zip of the code directory.   You would still need to re-edit the config.php file for your server and probably change ownership/permissions on all files as well as import the sql provided.

If interested, contact me via IM … and we'll start communicating directly via EMail.

'spirit of sharing', Ken

Average of ratings:Useful (2)
Picture of Myrrh Lynn
Re: upgrading to 2.0 ERROR: System Error reading from database

Hi Ken,Yes, indeed, it is painful! LOL! I appreciate your offer to help, but I have decided to go another route.

Average of ratings: -