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
Optional: Create a backup of the Directory Server directories:
Stop the instance:
# dsctl instance_name stop
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.
Copy the
/etc/dirsrv/slapd-instance_name/
directory:# cp -rp /etc/dirsrv/slapd-instance_name/ /root/etc-dirsrv-instance_name.bak/
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
Additional resources
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
Optional: Create a backup of the Directory Server directories.
-
Click the
Stop instance
. button, and select 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.
Copy the
/etc/dirsrv/slapd-instance_name/
directory:# cp -rp /var/lib/dirsrv/slapd-instance_name/ /root/etc-dirsrv-instance_name.bak/
-
Click the
-
Click the
Remove this instance
. button, and select -
Select
Yes, I am sure
, and click 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
Additional resources