Backup CentOS or Redhat Directory Server Database (LDAP)

Backup CentOS or Redhat Directory Server Database (LDAP)

To backup a CentOS or Redhat Directory Server database (LDAP), you can use the slapcat command. The slapcat command is a utility that is used to export the LDAP database to a file.

Here's an example of how to use the slapcat command to backup the LDAP database:

slapcat > ldap-backup.ldif
‮ruoS‬ce:www.lautturi.com

This command will export the LDAP database to a file called ldap-backup.ldif in the current directory.

You can also use the -b option to specify the base DN (distinguished name) of the LDAP database to be exported. For example:

slapcat -b "dc=example,dc=com" > ldap-backup.ldif

This will export only the part of the LDAP database under the dc=example,dc=com base DN.

To restore the LDAP database from a backup, you can use the slapadd command. The slapadd command is a utility that is used to import the LDAP database from a file.

Here's an example of how to use the slapadd command to restore the LDAP database from a backup:

slapadd < ldap-backup.ldif

This command will import the LDAP database from the ldap-backup.ldif file and overwrite the current LDAP database.

Created Time:2017-10-27 14:56:34  Author:lautturi