In the past we have had numerous reports about not all questions being included in backup, leading to restore errors. This is one example of report:
MDL-16275 (sure there are more).
Until now we thought it was one more or less uncommon situation, but reviewing the code I think it is really easy to get a non-consistent backup, missing entire categories.
1) Just create two categories, "A" and "B", then create one course "course A" in category "A".
2) In "course A" create one quiz and add one question to the category "A".
3) Move the course from category "A" to "category "B".
4) Make one backup of the course. The generated backup will be missing any question, so will break on restore for sure.
So, any course moved to another "branch" category using questions from question banks over course level will lead to broken backups. Really horrible.
Also, at the end... you can have one quiz using questions from any other context in the server what breaks any capability checking and friends.
IMO this should be fixed ASAP in 1.9 and reworked in 2.0. Also, ideally... we should prevent course movements to another branches if there are category-level question banks associated, to avoid the spread of questions transversally ASAP.