Before I posted, I checked all over the place to see if there were any examples or any kind of information that would rapidly provide the right kind of information. But in my review of documentation and code I see that backup and restore is an involved subject matter in Moodle and left to my own will require considerable study. I read the API information on backup and restore and I dived into code. The code is a bit challenging, it's like trying to take a sip out of a firehose, so much information to sift and sort through. There is one other thread on this subject and it remains unanswered. Rather than revive that thread which is years old, I want to pose this question using my needs or sensibilities.
We have been reusing courses term after term but finding this a bit too challenging as course material does change so it becomes difficult to modify quizzes. Well, it's actually impossible, once students have taken the quiz and their grades have been recorded. So, we want to do something else. We want to take the existing courses we have and use them as templates so to speak, and with each new term, we want to backup each course and restore them for various time slots/locations, so that each class time and location has its own course. Carbon copies of each other but separated.
I know how to do this interactively. It will take a very long time to do this interactively because we have 12 terms a year, and about 100 courses each term extrapolated out to 5 different time slots. Plus there's a possibility of a highly repeated action to have errors somewhere due to human elements. So, for sure, I want to do this programmatically! I want to backup activities, blocks, filters and question banks and then restore them into courses I have already created programmatically as carbon copies of the originals.
I'm busy coding the other components of this program, but need this bit of backup/restore to work in order for the big picture to be complete. If there's anyone out there who's done this before or understands enough about the architecture of the backup/restore API system that can help speed me to the right place, please respond.