A plugin to perform a backup/restore of every course in a category to a newly speicifed category, modifying some properties as you go.
Solves a common business requirement to roll over template courses into new instances each teaching period.
Moodle version | Branch | PHP |
---|---|---|
Moodle 4.1+ | MOODLE_401_STABLE |
7.4+ |
Put into your admin tools plugins folder and run the normal upgrade:
git clone [email protected]:catalyst/moodle-tool_clonecategory.git admin/tool/clonecategory
First, some assumptions.
- Your categories use IDNUMBERs. These will be used as a suffix to the cloned course shortnames.
- Your courses use shortnames that fit the format XXXXX_YYYYY where the segments are separated by an underscore.
- Cloned courses will have a new shortname consisting of the XXXXX part from the source course, plus underscore, plus the IDNUMBER of the destination category.
- Cloned courses will have their startdate and enddate set.
So, how this works:
- Be the moodle administrator.
- Navigate to your Admin > Plugins > Admin tools > Clone Category
- Select the source category, and destination category. You can optionally create the destination category by entering both the NAME and IDNUMBER (both must be entered to create a category, which will be created underneath the Desination Parent Category)
- Set the course start and end dates. The default dates are today and three months from today. You'll probably want to change this.
- Press the Clone Courses button, and then go make yourself a hot beverage or take a long stroll. This process can take many minutes to hours, depending on your source category size
If debugging is turned on, you'll see some output logs once the process completes showing you memory usage and cpu cycles per backup etc.
GPL3, same as Moodle