Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Comparing ldap data using net ldap

by strat (Canon)
on Jan 26, 2007 at 11:17 UTC ( #596693=note: print w/replies, xml ) Need Help??

in reply to Comparing ldap data using net ldap

Another way could be to dump the contents of both directories to LDIF files (e.g. with Net::LDAP::LDIF or ldap server tools), sorted by dn (e.g. with Net::LDAP::Control::SortResult) and then iterate over the two LDIF files and compare objects one by one.

if o1 eq o2: no change, read next both objects if o1 lt o2: add, read next object from LDIF1 if o1 gt o2: delete, read next object from LDIF2

Disadvantage: this way you usually can't compare values from userPassword.

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8."

Replies are listed 'Best First'.
Re^2: Comparing ldap data using net ldap
by perlknight (Pilgrim) on Jan 26, 2007 at 13:18 UTC
    my ldap entries have millions entry. Would Net::LDAP::LDIF be able to handle it; does it has a call back option? Thanks.

      I haven't tried Net::LDAP::LDIF with several million entries, but I think it can do it. For writing the objects to the LDIF you don't need callbacks from Net::LDAP::LDIF, only the callback from Net::LDAP::Search could be a good idea. If you dump your search result in a sorted way, you can read the objects one-by-one from the LDIF with a code similar to the synopsis from Net::LDAP::LDIF.

      Best regards,
      perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8."

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://596693]
[stevieb]: heh, yeah, sorry. This is integration testing for certain. In fact, it's even Continuous Integration ;)
[stevieb]: Obviously, Travis CI just won't cut it for these distributions...
[stevieb]: I went on my merry way writing a cross-platform, network-aware system that works across Perlbrew and Berrybrew systems and runs unit tests for Perl dists on all installed versions, with the ability to manage *brew commands themselves
[stevieb]: That worked out exceptionally well, as when I started that project, I hadn't delved into hardware development yet.
[stevieb]: found a issue in MetaCPAN::Client though today for my revdep tests. At least I think it's an issue

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2017-06-25 23:29 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (572 votes). Check out past polls.