Got a bit of an issue arising with backing up and restoring from one moodle to another.
I have roughly a couple hundred or so courses to go from one moodle to another, these are all used by users throughout the institute and make use of MNET to log in users using network accounts, multiple users are enrolled on each course both as Teachers and students.
While restoring backups that contains no users (guest accessible courses) the restores fails due to incorrect role mapping.
The two issues are:
string(115) "The Authenticated user role in the backup file cannot be mapped to any of the roles that you are allowed to assign."
string(128) "The Authenticated user on frontpage role in the backup file cannot be mapped to any of the roles that you are allowed to assign."
Looking in to the backup mbz file, under the roles.xml file I can see that it does appear to define the roles
<description><p>All logged in users.</p></description>
<name>Authenticated user on frontpage</name>
<p>All logged in users in the frontpage course.</p>
Is this an error that it is trying to take across the roles which cannot be defined by anyone, not even the Site Admin accounts?
If I do this manually, I am presented an option to restore the role mappings by selecting another role to use but I have been automating this with Moosh which does not present the option, failing instead.
What's the goal? Restore courses to a Moodle instance and contine to use
MNet? Is the server to which you are restoring already part of the MNetwork?
Or restore courses with users on a Moodle instance NOT part of MNetwork?
"use of MNET to log in users using network accounts"
Does that mean they login to another moodle and that moodle uses some sort
of authentication for the local lan/wan ... ldap?
In moodle_backup.xml of extracxted backup, look for a line
indicates there are no mnet_remote users in the backup.
The backup I was looking at did not come from an MNet configured instance.
Then, also, there's a section in users.xml
Although I have no idea what would go into those tags that might solve your problem.
Yet, if you look at users.xml you will probably see
accounts that already exist in the system you are try to restore to
and some of those might not be desired ... their roles.
On the mnet servers ... make *no user* backups and restore those? Then use csv file from old server to populate users on new server?
"On both, go to Administration > Site administration > Users > Permissions > Define Roles, only roles that have "Roam to a remote Moodle moodle/site:mnetlogintoremote" will be allowed to roam. Grant the privilege as appropriate.
eg. enabling for Authenticated user allows any authenticated user to roam between servers."
You might have to compare DB's of MNet servers ... any table related.
Might consider cloning the site???
And a suggestion that you are probably not going to like ... maybe it's time to move away from MNet and use other authentication methods that offer SSO. Yes, I know that would mean massive changes, but ...
know that is an old warning, but ...
Note: I used to 'preach' MNetworking to schools ... set several up. It was very unique and one of the features to Moodle that didn't exist in other LMS's .... and if one thinks about it, thus proprietary. Uhhhh ... not good for the way the world was moving at the time ... ever soooo slowly.
'spirit of sharing', Ken
Greatly appreciate the response Ken,
Your suggestions are all something I will have to consider,
In relation to the purpose, it's been decided that because out moodle instance is becoming so large that we will split them up by department (just trying it out in this instance but we have separate instances for external students and distance learners so why not) but since people have been progressively working on content with students they want all of their old courses (including data) taken across.
So far I have taken all the backups using the automated backup functionality (including user data) and written a script which uses Moosh to loop through courses and add into the relevant instance.
This does work but some courses were failing to restore due to the aforementioned issue with mapping role permissions, I'm noticing more and more that it appears to only happen with any course which didn't have any enrolled users, I have managed to successfully run through courses which do contain user information and these have restored sucessfully.
It may be that any course which fails I will have to manually restore as I am then presented with options to just bypass mapping the roles.
Thanks again for the response, I will work through your response (especially interested in breaking away from MNet so will spend some time looking into this)