Hi Sara. This might not be of much assistance, but I've been able to backup and restore today without issue. I don't recall ever receiving an 'invalid ID number' type error during backup.
Does the message differentiate between an invalid course ID or course module ID (CMID). Is there any chance that you've disabled a plugin that matches an activity Module (tool) within your course?
In this case, I could imagine an error when you attempt to restore a backup that contains this tool, as the matching tool is no longer available to restore into.