-
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 Directory Server, see Managing Entries. - Stop the Directory Server.
-
To import data from an LDIF file to the Directory 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 due to 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 Directory Server.
Page created: 26 Jul 2021
|
Page updated: 14 Jan 2022