In my institution, we are migrating to a new server, so I need to back up and restore the courses onto the new server provided by our server admin. Since I don't have access to server files, I'm exploring ways to restore courses in chunks. For instance, is it possible to restore courses via zip files? I tried this method but encountered an error. Are there any other methods available to restore these courses in bulk rather than restoring them individually?
Thanks
Not aware of any GUI plugin that does what you need done, however, there are a couple of ways via CLI:
https://docs.moodle.org/404/en/Course_restore#Course_restore_capabilities
a looping bash shell script used with:
https://docs.moodle.org/404/en/Course_restore#Restore_via_CLI_for_administrators
or
Moosh - a command line moodle utility
https://moosh-online.com/commands/#course-restore
again a looping bash script.
Maybe you need to share this response with the persons that do have CLI access.
'SoS', Ken
By performing the restore via the cli, the course name is replaced with a progressive number, which essentially makes this function useless (example: backup and restore of > 100 courses).
@moodle consultant
Is your purpose the same as the original poster in this thread? Migration to new server? Or you are NOT migrating and want to keep the same courses for next year but loose the students?
If your goal is to provide same courses for your next academic calendar year (something like that), then the better tool is reset. And since you have command line reset using Moosh.
I do this every year for a k12 entity after their grades have been turned in and school is out for the summer.
https://moodle.org/plugins/view.php?id=522
Moosh commands
https://moosh-online.com/commands/#course-reset
'SoS', Ken
yes, my purpose is almost the same. I need to backup a lot of courses ( > 200) from an old moodle and restore to a new installation.
I backed up all the courses and uploaded them to a dedicated area on the new server and restored them via cli.
I tried with a sh script but the result is as described (courses with a progressive number instead of the name). reading the php code of the file admin/cli/restore_backup.php, I can see that both corse fullname ad shortname are generated in a method called calculate_course_names and are not readed in the backup file.
Maybe I'm doing something wrong?
I've never used moosh, but I imagine it uses moodle's internal methods anyway.
Thank you
Think that only happens when the course you are restoring is already in existence.
Have been cleaning up a 4.1.highest site and was deleting courses (64 to be exact) that had not be used in years when I made a boo-boo and deleted one course that was hidden from view. Prior to deletions I made backups of those hidden courses. Teacher wanted to be able to get resources from that course and asked that it be restored. Restore done via moosh ... it came back in to same category where it was before - hidden - had a new ID - which was expected but no duplication ... course did not exist.
Not sure that moosh uses the same routines/code as the backup/restore scripts found in code/admin/cli/. One way to find out ... install moosh and do just one restore to a category ... that course doesn't exist in that category. You'll find other uses for moosh when it comes to massive stuff.
How old are those courses? (version of Moodle?)
'SoS', Ken