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?