Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6815

"Error writing to database"

$
0
0
by cyber sec.  

This is a constant problem. I am backing up from an online Moodle 3.7 site with a MySQLdatabase, and trying to restore to a desktop Moodle 3.7 site with a Postgres database. I think it may have something to do with StudentQuiz plugin. I turned on debugging. Here are the error messages:

Debug info: ERROR: duplicate key value violates unique constraint "mdl_studprog_queusestu_uix"
DETAIL: Key (questionid, userid, studentquizid)=(2554, 0, 53) already exists.
INSERT INTO mdl_studentquiz_progress (questionid,userid,lastanswercorrect,attempts,correctattempts,studentquizid) VALUES($1,$2,$3,$4,$5,$6) RETURNING id
[array (
'questionid' => 2554,
'userid' => 0,
'lastanswercorrect' => '1',
'attempts' => '2',
'correctattempts' => '2',
'studentquizid' => 53,
)]
Error code: dmlwriteexception
Stack trace:
  • line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 259 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
  • line 975 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
  • line 1023 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
  • line 191 of /mod/studentquiz/backup/moodle2/restore_studentquiz_stepslib.php: call to pgsql_native_moodle_database->insert_record()
  • line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_studentquiz_activity_structure_step->process_progress()
  • line 112 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
  • line 178 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
  • line 100 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 190 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
  • line 278 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
  • 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 210 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
  • line 178 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 377 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 143 of /backup/restore.php: call to restore_ui->execute()


Viewing all articles
Browse latest Browse all 6815

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>