Prior to importing data, you can validate an import file using the Directory Server's validate-ldif tool. When run, the tool binds to the Directory Server, locally or remotely, and validates the LDIF file to determine whether it violates the server's schema. Those elements that do not conform to the schema will be rejected and written to standard output. You can specify the path to the output file to which the rejected entries are written and the reasons for their rejection. The validate-ldif tool works with regular non-compressed LDIF files or gzip-compressed LDIF files.
To process large files faster, you can also set the number of threads for validation. The tool also provides options to skip specified schema elements if you are only validating certain items, such as attributes only. Use the --help option to view the arguments.
To validate an LDIF file:
Use the validate-ldif tool to validate an LDIF file. Make sure
the server is online before running this command.
$ bin/validate-ldif --ldifFile /path/to/data.ldif \ --rejectFile rejectedEntries
1 of 200 entries (0 percent) were found to be invalid. 1 undefined attributes were encountered. Undefined attribute departmentname was encountered 1 times.