Hello. I am using the moodle 3.1.5 and 4 times a year I have the need to restore 700 courses, in a time of 5 days, enrolling teacher and students. The students' is simple, thanks to the rise or massive enrollment of users, through the CSV. And for the other? They could help me to have a process, or, php, that having the course code (old), and the destination category, I could duplicate the course, but, without registered users (only the teacher), neither comments, nor answers , neither badges, nor advances, nor logs, nor historical? That is, only the resources and activities of the teacher, and the registered teacher. It can?.
Carlos ... you've posted the same question in both this forum (Developer) and in Moodle Partners. Your profile does say initial developer but are you a true developer?
Am not a developer myself ... just an experienced admin with 'interesting projects' from time to time.
Questions for you ... clarification ...
What operating system is server under? Linux ... if so what distro? Ubuntu/CentOS?
Is the server a standalone? ... code, DB server, and moodledata on same physical server?
How much space do you have available?
Do you have need of keeping a full backup of all courses for records retention purposes?
Have you looked into resetting courses?
Briefly, I have moved 3794 reset courses ... nu.mbz's ... from an old server to a new server where new server had same categories ... all courses in same cat's as they were in old server in the time span of 8 hours. All of it command line with a combination of bash shell scripts that used scripts residing in /moodlecode/admin/cli/, moosh, and scp from old to new server.
Not bragging ... BTW.
So depending upon answers to questions above I can give you a brief overview.
'spirit of sharing', Ken
Unless some true Developer or Moodle Partner cares to jump in here!
'spirit of sjaring', Ken