Previous Topic: ldif2dxc Tool—Convert Schema from LDIF to CA Directory Format

Next Topic: ldifsort Tool—Sort LDIF Records

ldifdelta Tool—Calculate the Difference Between LDIF Files

Use the ldifdelta tool to calculate the change, or delta, between two LDIF files. The ldifdelta program is an offline directory synchronization tool based on the LDAP directory interchange format. You can use ldifdelta to fully or partially synchronize directories.

You must do two things before using the ldifdelta tool:

  1. Get the two LDIF files you want to compare, oldfile and newfile, say.

    To do this, use the DXsearch tool (with the -L option) or the DXdumpdb tool.

  2. Sort the LDIF files using the ldifsort tool.

ldifdelta can produce an output file, which, is a file containing LDIF change records. You can use the DXmodify tool to apply these LDIF change records to the sorted oldfile, and so update it to newfile.

The ldifdelta tool has the following limitations:

The ldifdelta tool ignores the following operational attributes:

This command has the following format:

ldifdelta [-x] [-v] -S dsaname oldfile newfile [outfile]
-x

Ignores X.500 and DXserver operational attributes.

-v

Runs in verbose mode.

-S dsaname

Specifies the DSA server containing schema definitions.

Note: The DSA name is only used for schema checking. This does not imply that the LDIF and DSA name used are linked in any way.

oldfile

Specifies the outdated file to produce the delta for.

newfile

Specifies the more recent file to compare against oldfile.

outfile

(Optional) Specifies the output file containing the differences between newfile and oldfile.

If you do not specify this file, ldifdelta produces its output to the standard output.

Example: Using ldifdelta and ldifsort Together

This example makes the old directory the same as the reference directory:

dxsearch -L -h oldhost "(oc=*)" > old.ldif
dxsearch -L -h referencehost "(oc=*)" > ref.ldif
ldifsort old.ldif old_sorted.ldif
ldifsort ref.ldif ref_sorted.ldif
ldifdelta -x -S DSA1 old_sorted.ldif ref_sorted.ldif | dxmodify -h oldhost