Tech Tips

Using the Sun Directory Server Tools LDIFDIFF,PL and LDIFFSORT,PL to Verify Bulk Loads

2017-09-29 13:17
Steps to Verify a Bulk Load:

Import (ldif2db) users from entiredirectory.ldif.
Export the users (db2ldif) to entiredirectory.export.ldif.
Remove the entry ids:
egrep -v "entry-id|nsUniqueId" entiredirectory.ldif > \ entiredirectory.noids.ldif

egrep -v "entry-id|nsUniqueId" entiredirectory.export.ldif > \ entiredirectory.export.noids.ldif

Use “” to sort the files:
./contrib/ -k dn entiredirectory.noids.ldif > \ entiredirectory.noids.sorted.ldif

./contrib/ -k dn entiredirectory.export.noids.ldif > \ entiredirectory.export.noids.sorted.ldif

Use “ to diff the files:
./contrib/ -k dn entiredirectory.noids.sorted.ldif \ entiredirectory.export.noids.sorted.ldif

If there is no output, then both the LDIFS contain the same data.
Important Notes

These tools seem to work on Windows but USE THEM ON UNIX! Windows line breaks seem to break these tools.
I also tested changing the export file and using on it. As advertised, generates on standard output the LDIF changes needed to transform the target into the source.
One potential problem with output is that renaming the DN will result in a DELETE +ADD, not a MODRDN, so you will lose the createTimeStamp. (Of course, this could be fixed, with some perl programming.)
Article by Chris Paul, Seojindsa, Inc.
전체 0