Error upgrading to 2.6

Error upgrading to 2.6

by juice masters -
Number of replies: 7

I am currently using 2.2.6 and I am trying to upgrade to 2.6 but I am having some problems. I imported my production database through phpmyadmin and setup a directory with the 2.6 files so that I could test everything first. Everything goes smooth until I hit this error which stops the upgrade;

Debug info: Duplicate entry 'grading' for key 'mdl_quizrepo_nam_uix'
INSERT INTO mdl_quiz_reports (name,displayorder,capability) VALUES(?,?,?)
[array (
0 => 'grading',
1 => '6000',
2 => 'mod/quiz:grade',
)]
Error code: dmlwriteexception
Stack trace:
  • line 444 of \lib\dml\moodle_database.php: dml_write_exception thrown
  • line 1080 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1122 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 39 of \mod\quiz\report\grading\db\install.php: call to mysqli_native_moodle_database->insert_record()
  • line 486 of \lib\upgradelib.php: call to xmldb_quiz_grading_install()
  • line 1580 of \lib\upgradelib.php: call to upgrade_plugins()
  • line 431 of \admin\index.php: call to upgrade_noncore()

What can I do to fix this?

Average of ratings: -
In reply to juice masters

Re: Error upgrading to 2.6

by Mark Hayes -

Suggest going to 2.2.11 first.

In reply to Mark Hayes

Re: Error upgrading to 2.6

by juice masters -

I tried that and I got this error message:

Debug info: Table 'mdl_enrol_authorize' already exists
CREATE TABLE mdl_enrol_authorize (
id BIGINT(10) unsigned NOT NULL auto_increment,
paymentmethod VARCHAR(6) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'cc',
refundinfo SMALLINT(4) unsigned NOT NULL DEFAULT 0,
ccname VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
courseid BIGINT(10) unsigned NOT NULL DEFAULT 0,
instanceid BIGINT(10) unsigned NOT NULL DEFAULT 0,
userid BIGINT(10) unsigned NOT NULL DEFAULT 0,
transid BIGINT(20) unsigned NOT NULL DEFAULT 0,
status BIGINT(10) unsigned NOT NULL DEFAULT 0,
timecreated BIGINT(10) unsigned NOT NULL DEFAULT 0,
settletime BIGINT(10) unsigned NOT NULL DEFAULT 0,
amount VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
currency VARCHAR(3) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'USD',
CONSTRAINT PRIMARY KEY (id)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 DEFAULT COLLATE = utf8_general_ci
Stack trace:
  • line 400 of \lib\dml\moodle_database.php: ddl_change_structure_exception thrown
  • line 749 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 456 of \lib\ddl\database_manager.php: call to database_manager->execute_sql_arr()
  • line 408 of \lib\ddl\database_manager.php: call to database_manager->install_from_xmldb_structure()
  • line 347 of \lib\upgradelib.php: call to database_manager->install_from_xmldb_file()
  • line 1437 of \lib\upgradelib.php: call to upgrade_plugins()
  • line 269 of \admin\index.php: call to upgrade_noncore()
In reply to juice masters

Re: Error upgrading to 2.6

by juice masters -

I tried the 2.2.6 -> 2.6 upgrade again and just for fun I tried renaming the problem tables (ie.'grading1').  The upgrade finished but I got another error saying "Installation must be finished from the original IP address, sorry."  This is even more confusing because unless the IP address is stored in the quiz reports table I wouldn't expect this error.  The cofig file is setup as it should be.

In reply to juice masters

Re: Error upgrading to 2.6

by juice masters -

I am suprised that  no one has any advice for my situation.  Another option I am looking at is to import my current database to an empty one, create a moodle directory with the 2.6 files, copy over my config to make the necessary changes and see if it will allow the installation but I am not sure what to use for a moodledata location?  I am hosting with GoDaddy if that makes much difference.  Please someone help! I have been using moodle for 2 years now and besides being a little slow everything is awesome except the upgrading process.

In reply to juice masters

Re: Error upgrading to 2.6

by Mark Hayes -

have you had a look at the docs on verifying the database schema?

http://docs.moodle.org/23/en/Verify_Database_Schema 

In reply to Mark Hayes

Re: Error upgrading to 2.6

by juice masters -

I have not tried that yet but I will. Are there any other suggestions to why I am getting these errors or how I can get around them. I really need to update moodle to take advantage of the new features. On my site it says that I am using 2.2.6 but when I do attempt the upgrade it says that I currently have 2.2.6 +.  Could this be causing some errors also?  If so, how can I correct it; I can't downgrade moodle.

In reply to juice masters

Re: Error upgrading to 2.6

by juice masters -

I tried using the godaddy server by creating a new database by importing my current 2.2.6 data then copied over the 2.6 files and updated the config file.  Once again everything went as planned until I got this message AGAIN;

quiz_grading

Error writing to database

More information about this error

It is usually not possible to recover from errors triggered during installation, you may need to create a new database or use a different database prefix if you want to retry the installation.

Debug info: Duplicate entry 'grading' for key 'mdl_quizrepo_nam_uix'
INSERT INTO mdl_quiz_reports (name,displayorder,capability) VALUES(?,?,?)
[array (
0 => 'grading',
1 => '6000',
2 => 'mod/quiz:grade',
)]
Error code: dmlwriteexception
Stack trace:
  • line 444 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 1080 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1122 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 39 of /mod/quiz/report/grading/db/install.php: call to mysqli_native_moodle_database->insert_record()
  • line 486 of /lib/upgradelib.php: call to xmldb_quiz_grading_install()
  • line 1580 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 431 of /admin/index.php: call to upgrade_noncore()

What on earth is causing this?  Why would the quiz table be causing such an issue?  I have marginal database skills but it seems like the 2.6 files are trying to overwrite the old quiz table but the old table is not allowing the overwrite.  Can anyone provide some insight into this problem?