Problem with backups: Column 'availablefrom' cannot be null

Problem with backups: Column 'availablefrom' cannot be null

by Oscar P.S. -
Number of replies: 1

Hello all. I am facing issues when I try to restore a backup from one of my platforms to another. One of the moodle's platform is version 2.9.1 and the one in which I am trying to restore the curse has the 2.5.1 version.

The problem is that when the restoring process is about to finish, Moodle sends this error: "Debug info: Column 'availablefrom' cannot be null"

The complete debug info is this:

Debug info: Column 'availablefrom' cannot be null
INSERT INTO mdl_course_modules (idnumber,added,score,indent,visible,visibleold,groupmode,groupingid,completion,completiongradeitemnumber,completionview,completionexpected,showdescription,course,module,section,groupmembersonly,availablefrom,availableuntil,instance) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => '',
1 => '1404815922',
2 => '0',
3 => '0',
4 => '1',
5 => '1',
6 => '0',
7 => 0,
8 => '0',
9 => NULL,
10 => '0',
11 => '0',
12 => '0',
13 => 29,
14 => '5',
15 => '282',
16 => 0,
17 => NULL,
18 => NULL,
19 => 0,
)]
Error code: dmlwriteexception
Stack trace:
  • line 426 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 1089 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1131 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 3037 of /backup/moodle2/restore_stepslib.php: call to mysqli_native_moodle_database->insert_record()
  • line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_module_structure_step->process_module()
  • line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
  • line 151 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 192 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
  • line 163 of /backup/util/plan/base_plan.class.php: call to restore_activity_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: <br /> <b>Notice</b>: Undefined property: stdClass::$availablefrom in <b>/var/www/vhosts/formacionaragon.com/distancia.formacionaragon.com/backup/moodle2/restore_stepslib.php</b> on line <b>3025</b><br /> <br /> <b>Notice</b>: Undefined property: stdClass::$availableuntil in <b>/var/www/vhosts/formacionaragon.com/distancia.formacionaragon.com/backup/moodle2/restore_stepslib.php</b> on line <b>3026</b><br />

Any ideas? Thanks!!

Average of ratings: -
In reply to Oscar P.S.

Re: Problem with backups: Column 'availablefrom' cannot be null

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Don't know.... but one likely cause for this sort of thing is a mismatch in functionality between Moodles.  That is, you have optional plugins in one that you don't have in the other. This isn't always handled well.