-
Create a .ldif file that contains entries or locate an existing
file.
The import-ldif tool requires a .ldif file, which conforms to standard LDIF syntax without change records. The
changeType
attribute is not allowed in the input LDIF. For information on adding entries to the PingDirectory server, see Managing Entries. - Stop the PingDirectory server.
-
To import data from an LDIF file to the PingDirectory server, use the import-ldif command.
Tip:
For assistance with the list of options, run import-ldif --help.
In the following example, the data is imported from the
data.ldif
file to theuserRoot
backend. Entries rejected because of schema violation are written with the rejection reason to therejects.ldif
file. Skipped entries, written toskipped.ldif
, occur if an entry cannot be placed under a branch node in the directory information tree (DIT) or if exclusion filters, such as--excludeBranch
,--excludeAttribute
, or--excludeFilter
are used. The --overwrite option instructs import-ldif to overwrite existing skipped and rejected files. The --overwriteExistingEntries option indicates that any existing data in the backend should be overwritten, and the --stripTrailingSpaces option strips trailing spaces on attributes that would otherwise result in an LDIF parsing error.$ bin/import-ldif --backendID userRoot --ldifFile /path/to/data.ldif --rejectFile rejects.ldif --skipFile skipped.ldif --overwrite --overwriteExistingEntries --stripTrailingSpaces
- Restart the PingDirectory server.