Backup and restore

Error when restoring course backup (only one course)

Picture of Sven Laudel
Error when restoring course backup (only one course)

We have a problem when restoring one special course.
First we cloned our old 1.9 system (latest 1.9 Moodle) and performed the update to this clone via Moodle 2.2 to 2.3.3+. In the next step we backup some courses and want to restore them in to our freshly installed Moodle 2.3.3+. This is where the problem with this one course occurs. All other courses restored with out any problems until now.

When restoring the backup we run into a database error. Here is what the error log says:

[Wed Feb 13 16:53:06 2013] [error] [client 139.x.x.x]
Default exception handler: Fehler beim Schreiben der Datenbank Debug:
FEHLER:  doppelter Schl\xc3\xbcsselwert verletzt Unique-Constraint \xc2\xbbmdl_wikisubw_wikgrouse_uix\xc2\xab\nINSERT INTO mdl_wiki_subwikis (groupid,userid,wikiid) VALUES($1,$2,$3) RETURNING id\n[array (\n  'groupid' => 0,\n  'userid' => 0,\n  'wikiid' => 68,\n)]
Error code: dmlwriteexception
* line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown
* line 239 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
* line 812 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 864 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
* line 80 of /mod/wiki/backup/moodle2/restore_wiki_stepslib.php: call to pgsql_native_moodle_database->insert_record()
* line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_wiki_activity_structure_step->process_wiki_subwiki()
* 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 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()

[Wed Feb 13 16:53:07 2013] [error] [client 139.x.x.x] Potential coding error - existing temptables found when disposing database. Must be dropped!

The error translates to something like "duplicate key value violates unique constraint" and it seems to be associated with one of the wikis contained in the course. Strangely the same error happens when restoring the course to another testing system with Moodle 2.3.3+. So it seems to be more a general problem.

It looks to me to be associated with the index "mdl_wikisubw_wikgrouse_uix"

System configuration:

Maybe someone can help fix this problem?

Thanks a lot

Average of ratings: -