Chapter 11. Removing a Directory Server instance

If you no longer require a Directory Server instance, you can remove it to regain disk space. If you run multiple instances on one server, removing a specific instance does not affect the other instances.

11.1. Removing an instance using the command line

You can remove a Directory Server instance using the command line.

Prerequisites

  • The instance has been removed from a replication topology, if it was part of one.

Procedure

  1. Optional: Create a backup of the Directory Server directories:

    1. Stop the instance:

      # dsctl instance_name stop
    2. Copy the /var/lib/dirsrv/slapd-instance_name/ directory:

      # cp -rp /var/lib/dirsrv/slapd-instance_name/ /root/var-lib-dirsrv-instance_name.bak/

      This directory contains the database, as well as the backup and export directory.

    3. Copy the /etc/dirsrv/slapd-instance_name/ directory:

      # cp -rp /etc/dirsrv/slapd-instance_name/ /root/etc-dirsrv-instance_name.bak/
  2. Remove the instance:

    # dsctl instance_name remove --do-it
    Removing instance ...
    Completed instance removal

Verification

  • Verify that the /var/lib/dirsrv/slapd-instance_name/ and /etc/dirsrv/slapd-instance_name/ directories have been removed:

    # ls /var/lib/dirsrv/slapd-instance_name /etc/dirsrv/slapd-instance_name/
    ls: cannot access '/var/lib/dirsrv/slapd-instance_name': No such file or directory
    ls: cannot access '/etc/dirsrv/slapd-instance_name': No such file or directory

11.2. Removing an instance using the web console

You can remove a Directory Server instance using the web console. However, if you want to create a backup of the Directory Server directories which contain, for example, the databases and configuration files, you must copy these directories on the command line.

Prerequisites

  • The instance has been removed from a replication topology, if it was part of one.
  • You are logged in to the instance in the web console.

Procedure

  1. Optional: Create a backup of the Directory Server directories.

    1. Click the Actions button, and select Stop instance.
    2. Copy the /var/lib/dirsrv/slapd-instance_name/ directory:

      # cp -rp /var/lib/dirsrv/slapd-instance_name/ /root/var-lib-dirsrv-instance_name.bak/

      This directory contains the database, as well as the backup and export directory.

    3. Copy the /etc/dirsrv/slapd-instance_name/ directory:

      # cp -rp /var/lib/dirsrv/slapd-instance_name/ /root/etc-dirsrv-instance_name.bak/
  2. Click the Actions button, and select Remove this instance.
  3. Select Yes, I am sure, and click Remove Instance to confirm.

Verification

  • Verify that the /var/lib/dirsrv/slapd-instance_name/ and /etc/dirsrv/slapd-instance_name/ directories have been removed:

    # ls /var/lib/dirsrv/slapd-instance_name /etc/dirsrv/slapd-instance_name/
    ls: cannot access '/var/lib/dirsrv/slapd-instance_name': No such file or directory
    ls: cannot access '/etc/dirsrv/slapd-instance_name': No such file or directory