comparing entries in two DS
We have recently designed a Central LDAP and imported all the data from the existing LDAP Servers.
The central LDAP has a new DIT with some changes in the DN format..like the DN format in the existing server is of the form
cn=abcs123+uid=jjjj123,ou=stnumber,o=homedepot.com,c=us..
The DN format in the new Central LDAP will be of the following format : uid=jjjj123,ou=Associates,dc=homedepot,dc=com
So Can we compare the entries in the old ldap with the new ldap to make sure that all the entries are imported into the Central LDAP without missing any entry....Can we do this with ldapcompare command or is there any other way of doing this..Any help is appreicated.
Regards
# 1
If you just want to compare that each old entry has a corresponding new entry (without regard to their attibutes and values) you can:
(1) do an ldapsearch on the old servers to gather up just the DN's,
(2) run them through your favorite combination of sed, awk, perl, ruby, etc. to change all the DN's into their new formats (this should be different logic than what originally converted the entries),
(3) sort the results,
(4) do a corresponding ldapsearch in the new DN's and sort the results,
(5) diff the results of #3 & #4.
If you need to check the attributes and values it's going to be harder, especially because you've probably made significant changes to them in the coversion process and would want to suppress those changes and/or ensure that the changes were made properly. At this point it's a job for perl, ruby, or your favorite powerful (references and associative arrays) scripting language.
It doesn't look like ldapcompare does what you would want. ldapcmp looks close as it will compare entries or subtrees, but from what I see in the man page both LDAP servers have to have the same base DN.
Maybe someone else will know another solution.