<?xml version="1.0" encoding="UTF-8"?>
<!--
! CCPL HEADER START
!
! This work is licensed under the Creative Commons
! Attribution-NonCommercial-NoDerivs 3.0 Unported License.
! To view a copy of this license, visit
! http://creativecommons.org/licenses/by-nc-nd/3.0/
! or send a letter to Creative Commons, 444 Castro Street,
! Suite 900, Mountain View, California, 94041, USA.
!
! You can also obtain a copy of the license at
! trunk/opendj3/legal-notices/CC-BY-NC-ND.txt.
! See the License for the specific language governing permissions
! and limitations under the License.
!
! If applicable, add the following below this CCPL HEADER, with the fields
! enclosed by brackets "[]" replaced with your own identifying information:
! Portions Copyright [yyyy] [name of copyright owner]
!
! CCPL HEADER END
!
! Copyright 2011-2012 ForgeRock AS
! Portions Copyright 2013 Jens Elkner
!
-->
<refentry xml:id="import-ldif-1" xmlns="http://docbook.org/ns/docbook"
version="5.0" xml:lang="en"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="common.xml" xpointer='xpointer(//info[@name="info"])'/>
<refmeta>
<refentrytitle><application>import-ldif</application></refentrytitle>
<xi:include href="common.xml" xpointer='xpointer(//manvolnum[@name="v1m"])'/>
</refmeta>
<refnamediv>
<refname><application>import-ldif</application></refname>
<refpurpose>import OpenDJ directory data from LDIF</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>import-ldif</command>
<arg>-a</arg>
<arg>-c</arg>
<arg>-O</arg>
<arg>-F</arg>
<arg>-S</arg>
<arg>-R <replaceable class="parameter">rejectFile</replaceable></arg>
<arg>-s <replaceable class="parameter">seed</replaceable></arg>
<arg>-A <replaceable class="parameter">templFile</replaceable></arg>
<arg>-n <replaceable class="parameter">backendName</replaceable></arg>
<arg>-b <replaceable class="parameter">incBranchDN</replaceable></arg>
<arg>-B <replaceable class="parameter">excBranchDN</replaceable></arg>
<arg>-i <replaceable class="parameter">incAttr</replaceable></arg>
<arg>-e <replaceable class="parameter">excAttr</replaceable></arg>
<arg>-I <replaceable class="parameter">incFilter</replaceable></arg>
<arg>-E <replaceable class="parameter">excFilter</replaceable></arg>
<arg>-l <replaceable class="parameter">infile</replaceable></arg>
<arg>--countRejects</arg>
<arg>--skipDNValidation</arg>
<arg>--skipFile <replaceable class="parameter">logFile</replaceable></arg>
<arg>--threadCount <replaceable class="parameter">count</replaceable></arg>
<arg>--tmpdirectory <replaceable class="parameter">path</replaceable></arg>
<sbr/><sbr/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-remote"]/*)'/>
<sbr/><sbr/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-auth"]/*)'/>
<sbr/><sbr/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-task"]/*)'/>
<sbr/><sbr/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-props"]/*)'/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-misc"]/*[@name="sc-quiet"])'/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="s-general"]/*)'/>
</cmdsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>
This utility can be used to import LDIF data into a directory server backend.
</para>
</refsection>
<refsection>
<title>Options</title>
<para>
The following options are supported.
</para>
<variablelist>
<varlistentry>
<term><option>-a, --append</option></term>
<listitem>
<para>
Add to the given backend. If not specified, all entries in the backend get
deleted first unless it contains more than one baseDN.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-A, --templateFile</option> <replaceable
class="parameter">file</replaceable></term>
<listitem>
<para>
Path to a MakeLDIF template to use to generate the import data.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-b, --includeBranch</option> <replaceable
class="parameter">branchDN</replaceable></term>
<listitem>
<para>
Base DN of a branch to include in the LDIF import.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-B, --excludeBranch</option> <replaceable
class="parameter">branchDN</replaceable></term>
<listitem>
<para>
Base DN of a branch to exclude from the LDIF import.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-c, --isCompressed</option></term>
<listitem>
<para>
LDIF file is compressed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--countRejects</option></term>
<listitem>
<para>
Count the number of entries rejected by the server and return that value as the
exit code (values &gt; 255 will be reduced to 255 due to exit code restrictions).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-e, --excludeAttribute</option> <replaceable
class="parameter">attribute</replaceable></term>
<listitem>
<para>
Attribute to exclude from the LDIF import.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-E, --excludeFilter</option> <replaceable
class="parameter">filter</replaceable></term>
<listitem>
<para>
Filter to identify entries to exclude from the LDIF import.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-F, --clearBackend</option></term>
<listitem>
<para>
Remove all entries for all base DNs in the backend before importing.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-i, --includeAttribute</option> <replaceable
class="parameter">attribute</replaceable></term>
<listitem>
<para>
Attribute to include in the LDIF import.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-I, --includeFilter</option> <replaceable
class="parameter">filter</replaceable></term>
<listitem>
<para>
Filter to identify entries to include in the LDIF import.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-l, --ldifFile</option> <replaceable
class="parameter">file</replaceable></term>
<listitem>
<para>
Path to the LDIF file to be imported.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-n, --backendID</option> <replaceable
class="parameter">backendName</replaceable></term>
<listitem>
<para>
Backend ID the target backend for the import.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-O, --overwrite</option></term>
<listitem>
<para>
Overwrite an existing rejectFile and skipFile rather than appending to it.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-r, --replaceExisting</option></term>
<listitem>
<para>
Replace existing entries when appending to a backend.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-R, --rejectFile</option> <replaceable
class="parameter">rejectFile</replaceable></term>
<listitem>
<para>
Write rejected entries to the specified file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-s, --randomSeed</option> <replaceable
class="parameter">seed</replaceable></term>
<listitem>
<para>
Seed for the MakeLDIF random number generator (Default: 0).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-S, --skipSchemaValidation</option></term>
<listitem>
<para>
Skip schema validation during the LDIF import.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--skipDNValidation</option></term>
<listitem>
<para>
Perform DN validation during later part of LDIF import.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--skipFile</option> <replaceable
class="parameter">file</replaceable></term>
<listitem>
<para>
Write skipped entries to the specified file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--threadCount</option> <replaceable
class="parameter">count</replaceable></term>
<listitem>
<para>
Number of threads used to read LDIF file during import. (Default: 0, implies
2 x (number of CPUs)).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--tmpdirectory</option> <replaceable
class="parameter">path</replaceable></term>
<listitem>
<para>
Path to temporary directory for index scratch files during LDIF import (Default:
<varname>$INSTANCE_ROOT</varname><filename>/import-tmp/</filename>).
</para>
</listitem>
</varlistentry>
</variablelist>
<refsection>
<title>Task Backend Connection Options</title>
<variablelist>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-remote"]/*)'/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-auth"]/*)'/>
</variablelist>
</refsection>
<refsection>
<title>Task Scheduling Options</title>
<variablelist>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-task"]/*[not(@name="lc-stop")])'/>
</variablelist>
</refsection>
<refsection>
<title>Utility Input/Output Options</title>
<variablelist>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-props"]/*)'/>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-misc"]/*[@name="lc-quiet"])'/>
</variablelist>
</refsection>
<refsection>
<title>General Options</title>
<variablelist>
<xi:include href="common.xml"
xpointer='xpointer(//para[@name="l-general"]/*)'/>
</variablelist>
</refsection>
</refsection>
<refsection>
<title>Examples</title>
<informalexample>
<para>
The following example imports the content of the LDIF file,
<filename>Example.ldif</filename>, with the server offline.
</para>
<literallayout><prompt
>$ </prompt><command>import-ldif -b dc=example,dc=com -n userRoot \
-l /tmp/Example.ldif</command></literallayout>
<screen>
[21/Jun/2011:13:38:03 +0200] category=RUNTIME_INFORMATION severity=NOTICE...
... msg=Import LDIF environment close took 0 seconds
</screen>
</informalexample>
</refsection>
<xi:include href="common.xml" xpointer='xpointer(//refsection[@name="env"])'/>
<xi:include href="common.xml" xpointer='xpointer(//refsection[@name="exit-0-gt0"])'/>
<xi:include href="common.xml" xpointer='xpointer(//refsection[@name="seeAlso"])'/>
</refentry>