The ldif-diff utility identifies the differences between two LDIF files.
The ldif-diff utility can be used to identify the differences between two LDIF files. The resulting output can be displayed on the terminal or saved to an output file. The resulting output contains all of the information necessary for someone to reverse any changes if necessary. For modify operations, only sets of add and delete change types are used, not the replace change type. For delete operations, the contents of the entry that has been removed are included in the changes displayed in the form of comments.
This utility was designed to work on small data sets. It is only suitable in cases in which both the source and target data sets can fit entirely in memory at the same time. It is not intended for use on large data sets that cannot fit in available memory.
The ldif-diff utility accepts an option in either its short form (for example, -o outputFile) or its long form equivalent (for example, --outputLDIF outputFile).
Specify the path to the output file to record the changes between the source and target LDIF data. If this is not provided, then the change information will be written to standard output.
Overwrite the output file specified with the --outputLDIF option. This option indicates that if the specified output file already exists that the file should be overwritten rather than appending to it. The option is only applicable if --outputLDIF is used.
Specify the path to the source LDIF file, which contains the original data with no changes applied. This option is required.
Run in Single Value Change mode, in which each modify operation is broken into a separate modification per attribute value. For example, if a single modification adds five values to an attribute, the changes appear in the output as five separate modifications, each adding one attribute.
Specify the path to the target LDIF file that contains the differences from the source LDIF. This option is required.
Display command usage information and exit without attempting to perform any additional processing.
Display the directory server version information and exit rather than attempting to run this command.
The following examples show how to use the directory server commands. You can use the commands on any UNIX, Linux, or Windows system that has at least the Java SE 5 (at least Sun version 1.5.0_08, preferably the latest version of Java SE 6) runtime environment installed on its target system. See Directory Server System Requirements in Sun OpenDS Standard Edition 2.0 Installation Guide for more information.
The following command compares a source file (-s) with a target file (-t) and outputs the differences. For Windows platforms, specify the paths for the source file (for example, -s \temp\quentin.ldif) and the target file (for example, -t \temp\quentin.ldif):
$ ldif-diff -s /usr/local/quentin.ldif -t /usr/local/quentinr.ldif dn: uid=qcubbins,ou=People,dc=example,dc=com changetype: delete # objectClass: person # objectClass: organizationalPerson # objectClass: top # objectClass: inetOrgPerson # cn: Quentin Cubbins # sn: Cubbins # uid: qcubbins # userPassword: qcubbins # givenName: Quentin # description: This is Quentin's description. # mail: email@example.com dn: uid=qrcubbins,ou=People,dc=example,dc=com changetype: add objectClass: person objectClass: organizationalPerson objectClass: top objectClass: inetOrgPerson cn: Quentin R Cubbins sn: Cubbins uid: qrcubbins userPassword: qrcubbins givenName: Quentin description: This is Quentin R's description. mail: firstname.lastname@example.org
The following command compares a source file (-s) with a target file (-t) and sends the output to a file (-o). For Windows platforms, specify the paths for the source file (for example, -s \temp\quentin.ldif) and the target file (for example, -t \temp\quentin.ldif):
$ ldif-diff -s /usr/local/quentin.ldif -t /usr/local/quentinr.ldif \ -o output.ldif
An exit code of 0 indicates that the operation completed successfully. An exit code of 1 or greater indicates that an error occurred during processing.
UNIX, Linux: install-dir/bin/ldif-diff