Forums | Mahara Community
Support
/
"Merging" Institutions
27 May 2014, 21:24
We used to have multiple Moodle sites, so set up our Mahara with 9 institutions to match the Moodle sites.
We now want to move to a single Moodle and a single Institution.
The trouble is that we have thousands of users many of which are in multiple institutions. I need to find a way to bulk move them into the 'new' one. At a glance, this seems far from straightforward as all sorts of things link to the Institution. I don't want to loose any Groups in the move either.
Has anybody done anything like this and/or can provide any advice.
I expect that I am going to have to script something but I thought I would ask in case anybody has been here before :)
02 June 2014, 17:29
Hello Howard,
This may not be as difficult as you may think. :-)
You don't have to worry about groups as they are mostly independent of institutions. Group membership is not lost when you move a user from one institution into another.
From what you wrote I gather that your site is set up to allow users to be in multiple Mahara institutions. Thus, you can add them all to your new institution. If you do not want your users to receive an email about this move, you could change the config file temporarily to have all emails sent to a different address:
$cfg->sendallemailto = 'emailaddressinhere';
Now that all your users are in one institution, you can remove them from the others. If you don't do that, you will not be able to delete the authentication methods and thus the institutions.
Once you have done that, you will need to consolidate the authentication method and the remote username to match your new Moodle instance. You can take a look at the instructions on how to do that. If you cannot change the authentication method this way, you may need to change their authentication method first to the new one and then add the correct remote username.
At this point, all your users should be in one institution, have the correct authentication method to log in from Moodle and not be members of any other institution anymore. I'd suggest to delete all old institutions.
As this is quite a bit of work, I'd suggest to walk this through on a test server or with a few users only before changing everything for everyone.
Alternatively, you could update the database directly with the new authentication method and assign that to all users esp. if the remote username doesn't change. But still be careful and test that your users can still log in.
And don't forget to remove the config.php value from above once you are done.
Cheers
Kristina