Skip to content

Instantly share code, notes, and snippets.

@phette23
Created December 21, 2020 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phette23/35209bfed7d15bacc155106299780481 to your computer and use it in GitHub Desktop.
Save phette23/35209bfed7d15bacc155106299780481 to your computer and use it in GitHub Desktop.
bulk Moodle template restore
# NOTE: make sure the course-list query returns the courses you want and also that the right backup is
# referenced in the course-restore command. The query should probably use shortnames (e.g. example is
# all First Year 4D courses), as opposed to something like categories, because you can target metacourses.
for id in $(moosh -n course-list -i 'shortname LIKE "FYCST-1120%-2021SP"'); do
moosh -n course-restore --overwrite ~/backup-*.mbz $id;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment