Chapter 2. Exporting data from Directory Server

Export data from the Directory Server database to an LDIF file using the command line or the web console.

Note

The export operations include only directory data. Export does not include the configuration information (cn=config), schema information (cn=schema), and monitoring information (cn=monitor).

Use the export feature to:

  • Copy data to another Directory Server.
  • Export data to another application.
  • Repopulate databases after a change to the directory topology.
  • Split the database.

2.1. Exporting data using the command line while the server is running

To export data while the Directory Server instance is running, use the dsconf backend export command.

Prerequisites

  • The dirsrv user has write permissions in the destination directory.
  • The Directory Server instance is running.

Procedure

  1. Use the dsconf backend export command to export data to an LDIF file.

    For example, to export the userRoot database:

    # dsconf -D "cn=Directory Manager" ldap://server.example.com backend export userRoot
    The export task has finished successfully

    By default, dsconf stores the export in a file called instance_name_database_name-time_stamp.ldif in the /var/lib/dirsrv/slapd-instance_name/export/ directory. Alternatively, add the -l file_name option to the command to specify a different location.

  2. Search the /var/log/dirsrv/slapd-instance_name/errors log for problems during the export.

Additional resources

2.2. Exporting data using the command line while the server is offline

If the Directory Server instance is offline, use the dsctl db2ldif command to export data.

Prerequisites

  • The dirsrv user has write permissions in the destination directory.
  • The Directory Server instance is not running.

Procedure

  1. Use the dsctl db2ldif command to export data to an LDIF file. For example, to export the userRoot database to the /var/lib/dirsrv/slapd-instance_name/example.ldif file:

    # dsctl instance_name db2ldif userRoot /var/lib/dirsrv/slapd-instance_name/example.ldif
    OK group dirsrv exists
    OK user dirsrv exists
    ldiffile: /var/lib/dirsrv/slapd-instance_name/example.ldif
    [18/Jul/2021:10:46:03.353656777 +0200] - INFO - ldbm_instance_config_cachememsize_set - force a minimal value 512000
    [18/Jul/2021:10:46:03.383101305 +0200] - INFO - ldbm_back_ldbm2ldif - export userRoot: Processed 160 entries (100%).
    [18/Jul/2021:10:46:03.391553963 +0200] - INFO - dblayer_pre_close - All database threads now stopped
    db2ldif successful
  2. Search the /var/log/dirsrv/slapd-instance_name/errors log for problems during the export.
  3. Optional: Start the instance:

    # dsctl instance_name start

Additional resources

2.3. Exporting data using the web console while the server is running

Directory Server supports exporting data using the web console.

Prerequisites

  • The dirsrv user has write permissions in the destination directory.
  • The Directory Server instance is running.
  • You are logged in to the instance in the web console.

Procedure

  1. Open the Database menu.
  2. Select the suffix entry.
  3. Click Suffix Tasks, and select Export Suffix.
  4. Enter the name of the LDIF file in which you want to store the export. Directory Server will store the file in the /var/lib/dirsrv/slapd-instance_name/ldif/ directory using the specified file name.
  5. Click Export Database.
  6. To check the log for problems during the export, open the MonitoringLoggingErrors Log menu.

2.4. Additional resources