Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-74962

Error restoring a Moodle 2.0 course backup with quizzes/questions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 4.0.1, 4.1
    • Questions, Quiz
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • Hide

      If there is anyone in the world who has a Moodle 2.0.x backup cointaining questions that they need, then a work-aroudn to restore it into latest Moodle would be:

      1. Find or create a Moodle 3.11 install.
      2. Restore the backup there.
      3. Re-backup to get a modern-style backup.
      4. Restore that backup into Moodle 4.x
      Show
      If there is anyone in the world who has a Moodle 2.0.x backup cointaining questions that they need, then a work-aroudn to restore it into latest Moodle would be: Find or create a Moodle 3.11 install. Restore the backup there. Re-backup to get a modern-style backup. Restore that backup into Moodle 4.x

      Trying to restore the attached course (very old 2.0 that I use as seed for all my new sites), I've got this error:

      Debug info: ERROR: column slot.questionid does not exist
      LINE 4: JOIN mdl_quiz_slots slot ON slot.questionid ...
      ^
       
      SELECT q.*, slot.maxmark
      FROM mdl_question q
      JOIN mdl_quiz_slots slot ON slot.questionid = q.id
      WHERE q.id = $1 AND slot.quizid = $2
      [array (
      0 => 3,
      1 => '1',
      )]
      Error code: dmlreadexception × Dismiss this notification
      Stack trace:
      line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 329 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 1008 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 1671 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
      line 295 of /question/engine/upgrade/upgradelib.php: call to moodle_database->get_record_sql()
      line 331 of /question/engine/upgrade/upgradelib.php: call to question_engine_upgrade_question_loader->load_question()
      line 134 of /question/engine/upgrade/upgradelib.php: call to question_engine_upgrade_question_loader->get_question()
      line 6154 of /backup/moodle2/restore_stepslib.php: call to question_engine_attempt_upgrader->load_question()
      line 571 of /mod/quiz/backup/moodle2/restore_quiz_stepslib.php: call to restore_questions_activity_structure_step->process_legacy_quiz_attempt_data()
      line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_quiz_activity_structure_step->process_quiz_attempt_legacy()
      line 121 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
      line 150 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
      line 208 of /backup/util/xml/parser/progressive_parser.class.php: call to grouped_parser_processor->after_path()
      line 288 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->inform_end()
      line ? of unknownfile: call to progressive_parser->end_tag()
      line 179 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
      line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
      line 110 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
      line 181 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
      line 219 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
      line 191 of /backup/util/plan/base_plan.class.php: call to restore_activity_task->execute()
      line 168 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
      line 394 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
      line 219 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
      line 144 of /backup/restore.php: call to restore_ui->execute()
      

      Basically, it seems that the "conversion" (upgrade) code that is applied both in upgrade and restore... is still trying to use some database columns (like quiz_slots.questionid) that don't exist anymore.

      I bet this kills the restore of any old backup file (haven't verified it with others but with the attached one).

        1. backup_test-2.0.mbz
          1.14 MB
          Eloy Lafuente (stronk7)

            timhunt Tim Hunt
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.