I am having the same problem with quizzes that are a couple of months old. I do not understand how to run the commands you have posted. Could you post an explanation for dummies?
Message to Moodle developers: COULD SOMEBODY JUST FIX THE PROBLEM?
I spend a lot of time developing quizzes and I plan on re-using them; my students need them to study for the final exam. What's the point if all my work is lost after two months??