LDAP Sync - Migrate from Manual Users

LDAP Sync - Migrate from Manual Users

by Shawn Peters -
Number of replies: 3
Hoping someone can point me in the right direction here....

We have a large amount of users setup with manual accounts.  We now have LDAP / AD Sync working and that created a bunch more users (different account).

Our manual accounts & AD accounts have the exact same usernames.

How do I go about moving these account over to LDAP.  The LDAP Sync doesn't create a new user for them.

Suggestions?


Average of ratings: -
In reply to Shawn Peters

Re: LDAP Sync - Migrate from Manual Users

by Shawn Peters -

Just came across this:   https://moodle.org/mod/forum/discuss.php?d=186867


I can manually select the user and change the Authentication Type to LDAP, but you can't do this as a Bulk User Action.  But the above post goes through the option of either changing this through the DB via a script or doing a CSV import to 'update' the accounts.


I'll have to give it a try to see what happens.

In reply to Shawn Peters

Re: LDAP Sync - Migrate from Manual Users

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

That was going to my suggestion.  Either way will work - just make sure that you leave the admin user manual.  I normally do a db search on any user with userid greater than 2 (this normally takes care of admin and guest) and authentication manual and then update to LDAP.

In reply to Shawn Peters

Re: LDAP Sync - Migrate from Manual Users

by Shawn Peters -

CSV Import works just perfect.

You can export a list of all the current manual users ( https://docs.moodle.org/24/en/Import_and_export_FAQ#How_do_I_export_a_list_of_users.3F ) and then tweak the exported file to what you need updated.  I had to add the 'auth' and 'password' columns.

Here is what my test CSV looked like.  The second account was an admin account and Moodle actually stopped it from getting updated as it was an admin account.  Great feature to cover your butt just in case.


username,email,firstname,lastname,auth,password
user1,user1@domain.ca,manual,user1,ldap,
shawnp,shawnp@domain.ca,Shawn,P,ldap,

Average of ratings: Useful (1)