Menu Close
Settings Close

Language and Page Formatting Options

Chapter 1. Backing up Directory Server

A backup in Directory Server contains:

  • An LDIF file dse_index.ldif containing database indexed attributes
  • An LDIF file dse_instance.ldif containing instance configuration attributes
  • A directory for each backend, for example userRoot, which contains .db files for indexes defined in the database
  • A transaction log file log.*
  • A database version file DBVERSION

Note that Directory Server does not support backing up individual databases.

For details about backing up other important files, such as the configuration, see Backing up configuration files, the certificate database, and custom schema files.

In contrast to a backup, you can export data as described in Exporting data from Directory Server. Use the export feature to export specific data from a server, such as a subtree, in LDIF format.

1.1. Backing up all databases using the command line while the instance is running

To back up all databases of the Directory Server instance that is running, use the dsconf backup create command.

Prerequisites

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

Procedure

  1. Back up all databases:

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

    By default, dsconf stores the backup in a subdirectory called instance_name-YYYY_MM_DD_hh_mm_ss in the /var/lib/dirsrv/slapd-instance_name/bak/ directory. To specify a different location, append a directory name to the command.

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

Additional resources

1.2. Backing up all databases using the command line while the instance is offline

To back up databases when the Directory Server instance is offline, use the dsctl db2bak command.

Prerequisites

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

Procedure

  1. Back up all databases:

    # dsctl instance_name db2bak
    db2bak successful

    By default, dsctl db2bak stores the backup in a subdirectory called instance_name-YYYY_MM_DD_hh_mm_ss in the /var/lib/dirsrv/slapd-instance_name/bak/ directory. To specify a different location, append a directory name to the command.

    Optionally, pass the -v option to the command to display verbose output:

    # dsctl -v instance_name db2bak
    ...
    DEBUG: Instance allocated
    DEBUG: systemd status -> True
    ...
    INFO: db2bak successful
  2. Search the /var/log/dirsrv/slapd-instance_name/errors log for problems during the backup.
  3. Optional: Start the instance:

    # dsctl instance_name start

1.3. Backing up all databases using the web console

Directory Server supports data backup using the web console.

Prerequisites

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

Procedure

  1. Click the Actions button, and select Manage Backups.
  2. Click Create Backup.
  3. Enter a name for the backup, such as a time stamp to indicate the creation date and time of the backup.
  4. Click Create Backup.
  5. To check the log for problems during the backup, open the MonitoringLoggingErrors Log menu.

The server stores the backup in a subdirectory with the name you entered in the /var/lib/dirsrv/slapd-instance_name/bak/ directory.

1.4. Backing up configuration files, the certificate database, and custom schema files

The backup mechanism integrated into Directory Server backs up only the databases. However, there are additional files stored in the /etc/dirsrv/slapd-instance_name/ directory which are required to, for example, restore an instance on a different server after a hardware failure.

Note that you cannot back up the configuration directory in the web console.

Important

During the backup, do not update the certificate database. Otherwise, this database might not be consistent in the backup.

Procedure

  • Store the content of the /etc/dirsrv/slapd-instance_name/ directory into an archive file:

    # cd /etc/dirsrv/
    # tar -zcvf /root/config_slapd-instance_name-$(date +%Y-%m-%d_%H-%M-%S).tar.gz slapd-instance_name/

    This creates the /root/config_slapd-instance_name-time_stamp.tar.gz archive with the content of the /etc/dirsrv/slapd-instance_name/ directory.