I have a reasonably large set of data in an LDAP server. Some of the attributes appear in many places, and I would like to replace them.
The data is not enormous, but it is enough to rule out editing and export manually.
What's the best approach for this? Use an LDAP tool to find and replace them? Write a script to modify the entries? Export data and edit it locally?
Any suggestions would be helpful.
Presumably you can find all the dn's for entries where these attributes replace with something like
ldapsearch '(attribute=value)' |grep ^dn
and then for each entry make aldapmodify
script, so, using a bit of Python:I.e. for each entry you need to modify, generate a clause that states:
and feed that to
ldapmodify
(with the relevant authentication, etc command line arguments).