by Justin Hunt.
I also just had this error. It happened when I tried to restore a backupfile into a course, deleting the existing contents.
I was able to get around it, by restoring as a new course (and deleting the existing one afterwards).
Maybe that helps someone