Upgrading to Moodle 2.0

Published: Tue 07 June 2011

In Tech.

tags: moodle

Over the week-end, I thought it was time to see how my Moodle block handled the upgrade to 2.0. I did a brand new install of Moodle 1.9-latest, restored my old SQL dev backup, anxiously proceeded to start the upgrade and... ta-dah! Short answer: it doesn't work. Here are my notes on a couple of issues I encountered during the upgrade, so I don't waste time when I try again after updating the plug-in.

Upgrading: "Error: database connection failed"

I use PostgreSQL and after uploading the 2.0 code the site would only display "Error: database connection failed". I'm not sure what's the best way to move past this, but here what worked for me. The configuration string for Postgres dabatases always looked strange in config.php, something like this:

$CFG->dbhost    = 'user=\'mydbuser\' password=\'mydbpass\' dbname=\'moodle\'';

I changed it to this:

$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'moodle';
$CFG->dbuser    = 'mydbuser';
$CFG->dbpass    = 'mydbpass';

and happily, I was able to move on. Unfortunately I had forgotten to turn off debugging (activated from the SQL backup), and there may have been some CSS/theme trickery to set up before upgrading so... the upgrade screens were quite bare and sad looking.

Plugin "block/dvreport" is defective or outdated, can not continue, sorry.

The upgrade is quite a depressing process. Whenever it encounters a module that won't work with 2.0, it just shows this message about "defective" and "outdated" and won't move forward until the 'defective' module is removed. I just rm -rf'ed them since this is a dev system, but this was a fresh install, and besides DVReport these used to be standard modules. The migration path for people who actually used them must be painful.

No CSS, text-only homepage

After the upgrade, search for "Theme selector" and select a theme.