1. 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.
  2. Stop the Directory Server.
  3. Use the offline import-ldif to import data from an LDIF file to the Directory Server. 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 the userRoot backend. If any entry is rejected due to a schema violation, then the entry and the reason for the rejection is written to the rejects.ldif file. 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 (--excludeBranch, --excludeAttribute, or --excludeFilter). 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. Finally, the --stripTrailingSpaces option 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
  4. Re-start the Directory Server.