Problem restoring and importing

Problem restoring and importing

by mart van der niet -
Number of replies: 6

When trying to restore a course into an existing one, or importing activities/resources I get the following error:

 

Any hints/tips?

 

Debug info: Duplicate entry '28-flexsections-458-collapsed' for key 'mdl_courformopti_couforsec_uix'
INSERT INTO mdl_course_format_options (format,name,value,sectionid,courseid) VALUES(?,?,?,?,?)
[array (
0 => 'flexsections',
1 => 'collapsed',
2 => '1',
3 => '458',
4 => '28',
)]
Error code: dmlwriteexception
Stack trace:
  • line 429 of \lib\dml\moodle_database.php: dml_write_exception thrown
  • line 1107 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1149 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 1253 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_section_structure_step->process_course_format_options()
  • 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 163 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 130 of \backup\import.php: call to restore_controller->execute_plan()
Average of ratings: -
In reply to mart van der niet

Re: Problem restoring and importing

by Mark Pearson -

Looking at the debug information :

Duplicate entry '28-flexsections-458-collapsed' for key 'mdl_courformopti_couforsec_uix'

It seems that the problem has to do with the course format chosen (flex sections ?). I would try going back to the original course and switching the format to Topics, then repeat the backup and restore.

If you're moving courses between two different systems are you sure that you have the Flex sections course format in the target moodle installation?

In reply to Mark Pearson

Re: Problem restoring and importing

by mart van der niet -

Hi,

Did that: switched both courses to topics format. The activties of the course I restore (or import) end up blended into the sections of the receiving course, and not appended at the end, which I think is not what is intended...

In reply to Mark Pearson

Re: Problem restoring and importing

by llywelyn morgan -

I'm getting the same problem.  

I changed both courses to Topics format, as suggested by Mark, but am still getting the following error:

Debug info: Unknown column 't.entrytext' in 'field list'
SELECT t.id, t.entrytext, t.exittext
FROM mdl_taskchain t
JOIN mdl_backup_ids_temp b ON b.newitemid = t.id
WHERE b.backupid = ?
AND b.itemname = ?
[array (
0 => '7d5b5918ec703b366e8a5aaf90f46a99',
1 => 'taskchain',
)] 
Error code: dmlreadexception
Stack trace:
  • line 423 of \lib\dml\moodle_database.php: dml_read_exception thrown
  • line 942 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 103 of \backup\util\helper\restore_decode_content.class.php: call to mysqli_native_moodle_database->get_recordset_sql()
  • line 72 of \backup\util\helper\restore_decode_content.class.php: call to restore_decode_content->get_iterator()
  • line 81 of \backup\util\helper\restore_decode_processor.class.php: call to restore_decode_content->process()
  • line 450 of \backup\moodle2\restore_stepslib.php: call to restore_decode_processor->execute()
  • line 34 of \backup\util\plan\restore_execution_step.class.php: call to restore_decode_interlinks->define_execution()
  • line 153 of \backup\util\plan\base_task.class.php: call to restore_execution_step->execute()
  • line 163 of \backup\util\plan\base_plan.class.php: call to base_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()
In reply to llywelyn morgan

Re: Problem restoring and importing

by llywelyn morgan -

I'm also getting the following errors when trying to import one course's files into another:

Debug info: Unknown column 't.entrytext' in 'field list'
SELECT t.id, t.entrytext, t.exittext
FROM mdl_taskchain t
JOIN mdl_backup_ids_temp b ON b.newitemid = t.id
WHERE b.backupid = ?
AND b.itemname = ?
[array (
0 => '1f9d50f29d859f7fa22595d5aac8b4d8',
1 => 'taskchain',
)] 
Error code: dmlreadexception
Stack trace:
  • line 423 of \lib\dml\moodle_database.php: dml_read_exception thrown
  • line 942 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 103 of \backup\util\helper\restore_decode_content.class.php: call to mysqli_native_moodle_database->get_recordset_sql()
  • line 72 of \backup\util\helper\restore_decode_content.class.php: call to restore_decode_content->get_iterator()
  • line 81 of \backup\util\helper\restore_decode_processor.class.php: call to restore_decode_content->process()
  • line 450 of \backup\moodle2\restore_stepslib.php: call to restore_decode_processor->execute()
  • line 34 of \backup\util\plan\restore_execution_step.class.php: call to restore_decode_interlinks->define_execution()
  • line 153 of \backup\util\plan\base_task.class.php: call to restore_execution_step->execute()
  • line 163 of \backup\util\plan\base_plan.class.php: call to base_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 132 of \backup\import.php: call to restore_controller->execute_plan()
In reply to llywelyn morgan

Re: Problem restoring and importing

by Urs Giezendanner -

I have about the same Problem restoring a course (Using Moodle 2.4.3+ (Build: 20130418))

 

Error code: dmlwriteexception

Stack trace:
  • line 429 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 1107 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1149 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 63 of /question/type/poodllrecording/backup/moodle2/restore_qtype_poodllrecording_plugin.class.php: call to mysqli_native_moodle_database->insert_record()
  • line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_qtype_poodllrecording_plugin->process_poodllrecording()
  • line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
  • line 139 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 163 of /backup/util/plan/base_plan.class.php: call to base_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()
In reply to Urs Giezendanner

Re: Problem restoring and importing

by llywelyn morgan -

even stranger:

i just entered a course where an import failed.  after turning editing on, the imported material has now appeared.