PingDirectory

Validating an LDIF file

Before importing data, you can validate an import file using the PingDirectory server’s validate-ldif tool.

About this task

The tool binds to the PingDirectory server locally or remotely and validates the LDIF file to determine whether it violates the server’s schema. Elements that do not conform to the schema are rejected and written to standard output. You can specify the output filepath to which the rejected entries and reasons for their rejection are written. The validate-ldif tool works with regular non-compressed LDIF files or gzip-compressed LDIF files.

Steps

  • To validate an LDIF file, run the validate-ldif tool.

    Make sure the server is online before running this command.

    To process large files faster, you can 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.

    Example:

    $ bin/validate-ldif --ldifFile /path/to/data.ldif \
      --rejectFile rejectedEntries
    1. Optional: To view the arguments, use the --help option.

    Result:

    1 of 200 entries (0 percent) were found to be invalid.
    1 undefined attributes were encountered.
    Undefined attribute departmentname was encountered 1 times.