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

Restoring a backup on another site fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 2.3
    • Backup
    • None
    • MOODLE_23_STABLE
    • MDL-33605-master-integration
    • Hide

      Those steps failed before, so I took them from MDLQA-2127.

      1. Create a course, and add a reference file.
      2. Backup this course, at the end of backup process, you should be able to see a warning, "There are file references in this course, they can only be restored in this site"
      3. Save the backup file
      4. Restore the course on another moodle site (using the saved backup file), at the end of restoring process, you will warned some files cannot be restored because they are references
      5. Restore the course on the original site. There will not be any warnings and all file references will be restored correctly.

      Show
      Those steps failed before, so I took them from MDLQA-2127 . 1. Create a course, and add a reference file. 2. Backup this course, at the end of backup process, you should be able to see a warning, "There are file references in this course, they can only be restored in this site" 3. Save the backup file 4. Restore the course on another moodle site (using the saved backup file), at the end of restoring process, you will warned some files cannot be restored because they are references 5. Restore the course on the original site. There will not be any warnings and all file references will be restored correctly.

      When restoring a backup on another site, this exception is raised.

      Debug info: Column 'itemid' cannot be null
      INSERT INTO mdl_backup_ids_temp (backupid,itemname,itemid,newitemid,parentitemid,info) VALUES(?,?,?,?,?,?)
      [array (
      0 => 'b25f60f3ead1ddfd4b88346d9fe0f6d8',
      1 => 'course_sectionnumber',
      2 => NULL,
      3 => 0,
      4 => NULL,
      5 => NULL,
      )]
      Error code: dmlwriteexception
      Stack trace:
      line 416 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 952 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 994 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      line 269 of /backup/util/dbops/restore_dbops.class.php: call to mysqli_native_moodle_database->insert_record()
      line 1396 of /backup/util/dbops/restore_dbops.class.php: call to restore_dbops::set_backup_ids_cached()
      line 175 of /backup/util/plan/restore_structure_step.class.php: call to restore_dbops::set_backup_ids_record()
      line 1110 of /backup/moodle2/restore_stepslib.php: call to restore_structure_step->set_mapping()
      line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_section_structure_step->process_section()
      line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
      line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
      line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
      line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
      line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
      line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
      line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
      line ? of unknownfile: call to progressive_parser->end_tag()
      line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
      line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
      line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
      line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
      line 98 of /backup/moodle2/restore_section_task.class.php: call to base_task->execute()
      line 146 of /backup/util/plan/base_plan.class.php: call to restore_section_task->execute()
      line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
      line 315 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
      line 147 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
      line 46 of /backup/restore.php: call to restore_ui->execute()
      Output buffer: Notice: Undefined variable: oldsection in /home/fred/www/repositories/testing_master/moodle/backup/moodle2/restore_stepslib.php on line 1110

      I discovered this while testing MDLQA-2127.

        1. mdl33587-2.mbz
          383 kB
        2. mdl33578.mbz
          246 kB

            fred Frédéric Massart
            fred Frédéric Massart
            Sam Hemelryk Sam Hemelryk
            Frédéric Massart Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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