I have moodle 1 (m1) that has all the courses of the previous year on the server 1. I created a new moodle 2 (m2) on server 2. I want to process the existing courses in the moodle m1 database for the moodle database m2, including with the possibility of processing only a desired course. I've already coded the bank processing. I'm using Java. Moodledata has the folders corresponding to each course, when the course has some type of file stored. So I need the following:
I want to encode in Java the processing to copy each of the folders that is in moodledata that is corresponding to a given course. How to do this if the folder does not have a course code reference for the moodle 3.x version? How to know the correct folder in the moodledata of a particular course via programming?
Please help me!!
I think the rule of thumb in Moodle when it comes to handling its files, is to avoid touching the files directly. If you want to fetch the files belonging to a particular course, course module or plugin, then I suggest that you look at Moodle's File API.
Consider reading through the following content:
https://docs.moodle.org/dev/File_API, and this one:
They deal with how to handle Moodle files