Cohorts backup and restore

Cohorts backup and restore

by Zeid Fanous -
Number of replies: 2

Hi All, 

I am currently upgrading from Moodle 2.6 to Moodle 2.9. i am NOT doing a backup and restore of the site because it has a couple of lectures only. my question is how can i download a list of users with their corresponding cohorts. 'Bulk user action' downloads the list of users without their Cohorts. is there a way to solve this.


Thanks  smile 

Average of ratings: -
In reply to Zeid Fanous

Re: Cohorts backup and restore

by Ken Task -
Picture of Particularly helpful Moodlers

Don't know for sure, but wonder if this might not help ...

Make a full backup of one of the two courses - including users.   Download the backup.   The backup file from a 2.6 is a zip - just has a .mbz extension (unless you've turned on experimental items related to backups).   Unzip the backup.    There should be a users.xml file among the extracted folders/files from the backup.   Open that with a text editor and see if there are references to cohorts.

If there is, then one could restore courses to the 2.9 .... just to get the users and cohorts established (maybe).

'spirit of sharing', Ken


In reply to Ken Task

Re: Cohorts backup and restore

by Zeid Fanous -

Thank you Ken for that fast reply. 


Unfortunately there is no reference to cohorts. the other way around this i guess is to filter out all users with the Cohort id and then download them and match them on an Excel file. Obviously this  is not practical, but for 1 cohort it works. 


its seems a bit odd that cohorts are not backed up when you download user list. I will start using 'departments' also in the user profile. 


Thanks again Ken smile appreciate it.