Upgrading 1.94+ to 2.24+

Upgrading 1.94+ to 2.24+

by Sebastian Bergerot -
Number of replies: 3

Hi


i have to upgrade moodle 1.94+ to 2.2 and this error happens everytime, sometimes change the entry number but a cant continue


i try to delete the entries and the process continue to the next fail


on the fail 9, I´ve cancel the process, i restore the DB but the next time occurs on diffrent entry


sorry my english!!


Debug info: Duplicate entry '81717-1' for key 2
INSERT INTO mdl_question_attempts (questionid,variant,behaviour,questionsummary,rightanswer,maxmark,minfraction,flagged,responsesummary,timemodified,questionusageid,slot) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => '1938',
1 => 1,
2 => 'deferredfeedback',
3 => '¿Cuál es la función del elemento de seguridad?',
4 => 'Ambas',
5 => '0.8000000',
6 => 0,
7 => 0,
8 => 'Reducir los riesgos',
9 => '1350589451',
10 => '81717',
11 => 1,
)]
Stack trace:
  • line 397 of \lib\dml\moodle_database.php: dml_write_exception thrown
  • line 973 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1015 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 300 of \question\engine\upgrade\upgradelib.php: call to mysqli_native_moodle_database->insert_record()
  • line 254 of \question\engine\upgrade\upgradelib.php: call to question_engine_attempt_upgrader->insert_record()
  • line 222 of \question\engine\upgrade\upgradelib.php: call to question_engine_attempt_upgrader->save_usage()
  • line 177 of \question\engine\upgrade\upgradelib.php: call to question_engine_attempt_upgrader->convert_quiz_attempt()
  • line 132 of \question\engine\upgrade\upgradelib.php: call to question_engine_attempt_upgrader->update_all_attempts_at_quiz()
  • line 1112 of \mod\quiz\db\upgrade.php: call to question_engine_attempt_upgrader->convert_all_quiz_attempts()
  • line 540 of \lib\upgradelib.php: call to xmldb_quiz_upgrade()
  • line 271 of \lib\upgradelib.php: call to upgrade_plugins_modules()
  • line 1437 of \lib\upgradelib.php: call to upgrade_plugins()
  • line 269 of \admin\index.php: call to upgrade_noncore()

Average of ratings: -
In reply to Sebastian Bergerot

Re: Upgrading 1.94+ to 2.24+

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Wow! 1.9 -> 2.1+. That is ancient history.

I think I vaguely remember problems like this coming up before. And, I think, it tended to be the case that the before-upgrade data in the 1.9 site already had problems - but they were not enforced with database constraints, and in the new code, they are enforced so that subtle bugs don't go unnoticed for years.

Anyway, what to do: Well, randomly deleting things from your database is unlikely to make things better.

You need to investigate what the situation was in your Moodle 1.9 site before you try to upgrade. I think in that error, 81717 is likely to be the quiz_attempt id. So, go to the URL .../mod/quiz/review.php?attemptid=81717. Does that page display without errors. (Make sure Debugging is turned on.)

In reply to Sebastian Bergerot

Re: Upgrading 1.94+ to 2.24+

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

One possible problem is trying to upgrade from 1.9.4 to 2.2.

You must upgrade your 1.9.4. to 1.9.19 first, then you can upgrade to 2.2.

"If you are using an earlier version of Moodle, you must upgrade to the latest Moodle 1.9.x first." https://docs.moodle.org/22/en/Upgrading_to_Moodle_2.2

In reply to AL Rachels

Re: Upgrading 1.94+ to 2.24+

by Sebastian Bergerot -

Hi i´ve found the problem


was the memory size of the php, was setted to 128M, so i have upgraded to 1024M an it works!!


the server ran out of memory and when i hit F5 the data was duplicated


the platform was installed and never been upgraded, i have the work to upgrade but to upgrade to moodle 3 i have to upgrade to 2.2 first.


thansk for the answers!!