Upgrading from 1.9 10 to moodle 2 after many years of upgrades has failed - solutions welcome

Upgrading from 1.9 10 to moodle 2 after many years of upgrades has failed - solutions welcome

per Peter Birdsall,
Number of replies: 2

 

Our current moodle system was first installed in March 2004, and is important (vital) to the running of our business school. (Thanks very much moodle). Since then, with a few hiccups, we have been able to upgrade to the next level.

I was rather expecting the upgrade to rc2 to fail and it did. (seemed too much of a good thing for it to work sorire

Underneath is the fail response.

One thing - we do have the tables of our student database in the same database as the Moodle install, but just for convenience (it’s linked into the moodle user table). Doesn’t affect the workings of moodle. (This is the case since 2005)

Is this the end of the road for the continual upgrade success, or will Moodle2 be able to cope with aged data?

Kind regards

Peter (Educator and only hobyist network manager) at  Wittenborg Business University, The Netherlands.

The fault:

DDL sql execution error

More information about this error

Debug info: Duplicate entry '0-forum_displaymode' for key 3
CREATE UNIQUE INDEX userpref_usenam_uix ON user_preferences (userid, name)

Stack trace:

  • line 397 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
  • line 620 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 88 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
  • line 75 of /lib/ddl/database_manager.php: call to database_manager->execute_sql()
  • line 892 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
  • line 5414 of /lib/db/upgrade.php: call to database_manager->add_index()
  • line 1309 of /lib/upgradelib.php: call to xmldb_main_upgrade()
  • line 264 of /admin/index.php: call to upgrade_core()
Average of ratings: -
In reply to Peter Birdsall

Re: Upgrading from 1.9 10 to moodle 2 after many years of upgrades has failed - solutions welcome

per Tim Hunt,
Avatar Core developers Avatar Documentation writers Avatar Particularly helpful Moodlers Avatar Peer reviewers Avatar Plugin developers

For some reason, you seem to have data in the user_preferences table where userid is 0. That makes no sense, because userids start at 1 and increase from there.

So, if you have a back up and know how to roll back, then you can try cleaning up the crappy data with a command like

DELETE FROM user_preferences WHERE userid = 0

And then try the upgrade again.

Basically, you should be able to get the upgrade to work, but where you have rubbish in your database like this, you may need to clean it up first.

Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Upgrading from 1.9 10 to moodle 2 after many years of upgrades has failed - solutions welcome

per Peter Birdsall,

Thanks for the fast reply. Lots of Rubbish. I rather thought as much.

Will get some professional help in.