I created a test instance in the same server going through the following steps which I've put into a script:
a) got the new source, 2.1.1+, build 20110925, to http://my.site/21/
b) made a copy of $moodledata
c) dumped the database, searched an replaced http://my.site by http://my.site/21 and fed in to a new database
d) copied config.php of 1.9 into the 2.1 directory and modified $CFG->dbname, wwwroot and dataroot to match the new setup.
Now when I kick the new site it takes me to
- Upgrading Moodle database from version 1.9.12 (Build: 20110510) (2010061900.22) to 2.1.1+ (Build: 20110925) (2011070101.12)
- then to Server checks, all the status ok
- Plugins check has a whole bunch of "Missing from disk": cwhiteboard, dialogue, exercise, hotpot, ilpconcern, ilptarget, journal, lams, mindmap, admin, admin_tree ilp ilp_student_info, loancalc and presence. Those are for the time being ok, but I would like to know why mod/resource, mod/wiki and filter/multimovie are there.
Anyway, the main problem is the next step, which throws
Error writing to database
Debug info: Column 'itemid' cannot be null
SET itemid = (SELECT MIN(mdl_enrol.id)
JOIN mdl_context ON (mdl_context.contextlevel = 50 AND mdl_context.instanceid = mdl_enrol.courseid)
WHERE mdl_role_assignments.component = CONCAT('enrol_', mdl_enrol.enrol) AND mdl_context.id = mdl_role_assignments.contextid)
WHERE component <> 'enrol_manual' AND component LIKE 'enrol_%'
* line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
* line 708 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 4434 of /lib/db/upgrade.php: call to mysqli_native_moodle_database->execute()
* line 1423 of /lib/upgradelib.php: call to xmldb_main_upgrade()
* line 277 of /admin/index.php: call to upgrade_core()
This came up in Dec 2010 http://moodle.org/mod/forum/discuss.php?d=163300
and resolved 20. Dec 2010 http://tracker.moodle.org/browse/MDL-25681.
Why is this difference in the database now? Do I need to http://docs.moodle.org/en/Verify_Database_Schema and manually update/alter tables?