HP-UX Directory Server Administrator Guide HP-UX Directory Server Version 8.1 (5900-3098, May 2013)
Table 19 db2ldif options
DescriptionOption
Specifies the name of the database from which the file is being exported.-n
Specifies the suffix or suffixes to include in the export. If the suffix is a root suffix, such as
dc=example,dc=com, then the -n option is not required. There can be multiple -s arguments.
-s
Defines the output file to which Directory Server exports the LDIF. This file must be an absolute
path. If the -a option is not given, the output ldif is stored in the the
-a
/var/opt/dirsrv/slapd-instance_name/ldif directory and is automatically named
instance_name-database-YYYY_MM_DD_hhmmxx.ldif with the -n option or
instance_name-firstsuffixvalue-YYYY_MM_DD_hhmmxx.ldif with the -s option.
Specifies that the exported database is a consumer replica. In this case, the appropriate settings
and entries are included with the LDIF to initialize the replica when the LDIF is imported.
-r
Decrypts an encrypted database so it can be exported.-E
4.2.3.2 Exporting through the cn=tasks entry
The cn=tasks, cn=config entry in the Directory Server configuration is a container entry for
temporary entries that the server uses to manage tasks. Several common directory tasks have
container entries under cn=tasks, cn=config. Temporary task entries can be created under
cn=export, cn=tasks, cn=config to initiate an export operation.
The export task entry requires three attributes:
• A unique name (cn)
• The file name of the LDIF file to which to export the database (nsFilename)
• The name of the database to export (nsInstance)
It is also possible to supply the DNs of suffixes to include or exclude from the export operation,
analogous to the -s and -x options, respectively, for the db2ldif and db2ldif.pl scripts.
Additionally, if the database is a replica, then the appropriate replica information can be included
to initialize the new consumer when the LDIF is imported; this is set in the nsExportReplica,
corresponding to the -r option.
The entry is simply added using ldamodify, as described in “Adding and modifying entries using
ldapmodify” (page 112). For example:
ldapmodify -a -D "cn=directory manager" -w secret -p 389 -h server.example.com
dn: cn=example export, cn=export, cn=tasks, cn=config
objectClass: top
objectClass: extensibleObject
cn: example export
nsInstance: userRoot
nsFilename: /home/files/example.ldif
nsExportReplica: true
nsIncludeSuffix: ou=People,dc=example,dc=com
nsExcludeSuffix: ou=Groups,dc=example,dc=com
As soon as the task is completed, the entry is removed from the directory configuration.
The HP-UX Directory Server configuration, command, and file reference has more information on
the available attributes for running Directory Server export tasks under the cn=tasks entries.
4.3 Backing up and restoring data
Databases can be backed up and restored using the Directory Server Console or a command line
script.
• “Backing up all databases” (page 160)
• “Backing up the dse.ldif configuration file” (page 161)
4.3 Backing up and restoring data 159