by Jon Gillis.
We've recently run into errors with a restore from 3.9 to 4.1. When attempting to restore a mbz file, we are getting the following error
Default exception handler: Error writing to database Debug: ERROR: duplicate key value violates unique constraint "mdl_courmoduview_usecou_uix"
DETAIL: Key (userid, coursemoduleid)=(0, 2428) already exists.
INSERT INTO mdl_course_modules_viewed (userid,coursemoduleid,timecreated) VALUES($1,$2,$3) RETURNING id
[array (
'userid' => 0,
'coursemoduleid' => 2428,
'timecreated' => '1578412847',
)]
It appears our backups were made in 3.9 with User Completion Information so I'm assuming I'll need to remove that from the backup, but even then this feels like a bug. I am attempting to remove and rebuild the backup file in question, but any insights anyone has would be greatly appreciated.
Jon