Merge a local user account to a LDAP user account

LATEST Official version.
Questions and discussions - NO ISSUES
FOR ISSUES => http://mantis.testlink.org

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
rhford62
TestLink user
Posts: 3
Joined: Sun Feb 08, 2015 11:20 am

Merge a local user account to a LDAP user account

Post by rhford62 »

I had a previous version of testlink, version 1.9.11, running on a standalone PC running Ubuntu 10.04. I now have a load balancing VM Ubuntu 14.04 server up and running with testlink 1.9.13 installed. I have successfully ported the DB from an existing testlink server to the new VM server.

My company wants to use LDAP for user authentication but the old server used local accounts. I have configured the new testlink successfully to use LDAP but before I bring this server up to production level I would like to merge the users local accounts to the newly created LDAP ones.

I did the same with thing with bugzilla. Buzilla though has under the contrib directory a merge script which allowed me to merge the local account to the new LDAP user account.

Does testlink have a way to accomplish the same thing? Any help would be greatly appreciated.

Thank you

Bob Ford
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Merge a local user account to a LDAP user account

Post by fman »

Would you mind to explain with more details what do you mean for merge local accounts with LDAP account?
It's not clear for me
rhford62
TestLink user
Posts: 3
Joined: Sun Feb 08, 2015 11:20 am

Re: Merge a local user account to a LDAP user account

Post by rhford62 »

A local user account would be one which has been created and is managed locally in TestLink. Our original TestLink was configured this way but now we want all user authentication to be done via LDAP. I have LDAP working on the new server and it is configured to automatically create a non-existent user account once authentication via LDAP is successful.

So for an example if user1 has a local user account named JohnSmith@company.com but the LDAP credentials for this same user is jsmit. I want to be able to merge the locally managed user account JohnSmith@company.com to jsmit LDAP one.

I had to do the same thing with bugzilla. Fortunately bugzilla had a script under contrib named "merge-users.pl" which did all the work.

If this does not explain it well enough please let me know and I will try to explain it differently.

Thank you
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Merge a local user account to a LDAP user account

Post by fman »

you can change the login name using an sql script if you do not have now duplicated users.
No other option exists
rhford62
TestLink user
Posts: 3
Joined: Sun Feb 08, 2015 11:20 am

Re: Merge a local user account to a LDAP user account

Post by rhford62 »

Not being a database person, would anyone be willing to give an example of what this sql script should look like?

Thank you
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Re: Merge a local user account to a LDAP user account

Post by TurboPT »

It would be a series of update queries.

(CAUTION, as fman mentioned, there should NOT be any duplicate login names to use this method!)

Code: Select all

UPDATE users SET login='LDAPname1' WHERE login='existingName1';
UPDATE users SET login='LDAPname2' WHERE login='existingName2';
UPDATE users SET login='LDAPname3' WHERE login='existingName3';

... and so on to cover all users.
Know that if you DO happen to have duplicate login names, there is a way to achieve the same result, but another query would be needed to get other information (a unique identifier), and the above script's example will need changes to the WHERE clause criteria.
Post Reply