Page created: 24 Jul 2019 |
Page updated: 6 Nov 2019
Create an LDIF file that contains entries, or locate an existing file.
The import-ldif tool requires an LDIF file, which conforms to standard LDIF syntax without change records. This means the changeType attribute is not allowed in the input LDIF. For information on adding entries to the , see Managing Entries.
- Stop the Directory Server.
Use the offline import-ldif to import data from an LDIF file to the Directory Server. For assistance with the list of options, run
In the following example, the data is imported from the
data.ldiffile to the
userRootbackend. If any entry is rejected due to a schema violation, then the entry and the reason for the rejection is written to the
rejects.ldiffile. Skipped entries, written to skipped.ldif, occur if an entry cannot be placed under a branch node in the DIT or if exclusion filtering is used (
--excludeFilter). The --overwrite option instructs import-ldif to overwrite existing skipped and rejected files. The
--overwriteExistingEntriesoption indicates that any existing data in the backend should be overwritten. Finally, the
--stripTrailingSpacesoption strips trailing spaces on attributes that would otherwise result in a LDIF parsing error.
$ bin/import-ldif --backendID userRoot --ldifFile /path/to/data.ldif --rejectFile rejects.ldif --skipFile skipped.ldif --overwrite --overwriteExistingEntries --stripTrailingSpaces
- Re-start the Directory Server.