Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6815

Re: Prevent restore INTO specific courses

$
0
0
by Ken Task.  

Thanks for clarification ... not sure I fully understand ... but ... yeah, in right forum! smile

Suggest exploring moosh (command line only) commands looping bash shell scripts that loop through parameter list - parameter list could be course id numbers.

Some clips of related moosh commands:

course-backup
Example 3: Backup course id=3 without any user data (excludes users, logs, grade historyies, role assignments, comments, and filters):

moosh course-backup --template 3


In a looping script, the course ID numbers (the 3 above) would be the cids.txt file which are the course ID's to use in the loop.

There is also course-reset

course-reset

Reset course by ID. With -s or --settings option you can provide any supported setting for the restore. The value for -s option is a string with each setting in format key=value separated by space. This means you'll need to quote this string with double or single quotes when running the command. unenrol_users setting requires an array as a value - put at least one comma character (,) as a value to make moosh convert that into an array. Example:

moosh course-reset -s "reset_forum_all=1 reset_data=0 unenrol_users=6," 17


Add -n or --no-action to display all reset setting that would be used on course restore. When -n is used, no action is actually performed.

One could test what with -n.

There is also a course-restore

Not suggesting granting teachers access to command line, but in order to facilitate with limited IT staff resources, one might be able to come up with way(s) to do what is desired with a few bash shell scripts.

'SoS', Ken


Viewing all articles
Browse latest Browse all 6815

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>