2

I have an ldif file. I created it with this command:

kill -INT `cat /usr/local/var/run/slapd.pid`
slapcat -v -f /usr/local/etc/openldap/slapd.conf -l /usr/local/etc/openldap_backup/backup.`date +'%m-%d-%Y'`.ldif

And, I try to restore ldap database with:

slapadd -v -c -l backup.11-24-2017.ldif  -f /usr/local/etc/openldap/slapd.conf

But I have an error:

could not add entry .... (line=777): txn_aborted! DB_KEYEXIST: Key/data pair already exists (-30995)

How can I fix it?

1 Answers1

0

to save 2h for someone else I'll post it in here... you cannot use slapadd because not all entries are new. In this case use ldapmodify

more info in here How do I clone an OpenLDAP database

Thiago Conrado
  • 726
  • 8
  • 15