Red Hat Directory Server 8.0 Administrator's Guide
2. Run the db2ldif command-line script.
db2ldif -n database1 -a /export/output.ldif
This exports the database contents to /export/output.ldif. If the -a option is not
specified, then the database information is exported to
/var/lib/dirsrv/slapd-instance_name/ldif/instance_name-database1-date.ldif.
For example:
db2ldif -n database1
It is also possible to specify which suffixes to export, using the -s option. For example:
db2ldif -s "dc=example,dc=com"
The LDIF file in this case would be
/var/lib/dirsrv/slapd-instance_name/ldif/instance_name-example-2007_04_30_112718.ldif,
using the name of the suffix rather than the database.
If the suffix specified is a root suffix, such as dc=example,dc=com, then it is not necessary to
specify the database or to use the -n option.
For more information about using this script, see the Directory Server Configuration,
Command, and File Reference.
Option Description
-n Specifies the name of the database from
which the file is being exported.
-s 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.
-a 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
/var/lib/dirsrv/slapd-instance_name/ldif
directory and is automatically named
serverID-database-YYYY_MM_DD_hhmmxx.ldif
with the -n option or
Console
123