HP-UX Directory Server Administrator Guide HP-UX Directory Server Version 8.1 (5900-3098, May 2013)

To create a directory using LDIF:
1. Create an ASCII file containing the entries to add in LDIF format.
Make sure each entry is separated from the next by an empty line. Use just one line between
entries, and make sure the first line of the file is not be blank, or else the ldapmodify utility
will exit. For more information, see “Specifying directory entries Using LDIF” (page 549).
2. Begin each file with the topmost, or root, entry in the database.
The root entry must represent the suffix or sub-suffix contained by the database. For example,
if the database has the suffix dc=example,dc=com, the first entry in the directory must be
dn: dc=example,dc=com.
For information on suffixes, see the HP-UX Directory Server configuration, command, and file
reference.
3. Make sure that an entry representing a branch point in the LDIF file is placed before the entries
to create under that branch.
For example, to place an entry in a people and a group subtree, create the branch point for
those subtrees before creating entries within those subtrees.
NOTE:
The LDIF file is read in order, so parent entries must be listed before the child entries.
4. Create the directory from the LDIF file using one of the following methods:
Initializing the database through the Directory Server Console
Use this method if there is a small database to import (less than 10,000 entries). See
“Importing a database from the console” (page 148).
CAUTION:
This method is destructive and will erase any existing data in the suffix.
ldif2db or ldif2db.pl command line utility
Use this method if there is a large database to import (more than 10,000 entries). See
“Importing using the ldif2db command line script” (page 151).
ldif2db cannot be used if the server is running.
ldif2db.pl can only be used if the server is running.
CAUTION:
This method is destructive and will erase any existing data in the suffix.
ldapmodify command line utility with the -a parameter
Use this method if a new subtree is being added to an existing database or there is
existing data in the suffix, which should not be deleted. Unlike the other methods for
creating the directory from an LDIF file, Directory Server must be running before a subtree
can be added using ldapmodify. See Adding and modifying entries using
ldapmodify” (page 112).
A.5.1 LDIF file example
The following example shows an LDIF file that contains one domain, two organizational units, and
three organizational person entries:
dn: dc=example,dc=com
objectclass: top
objectclass: domain
dc: example
description: Fictional example domain
552 LDAP data Interchange Format