Im using slapcat to make backup like this:

slapcat -n 1 > ${BACKUP_PATH}/ldap.domain.com.ldif

Then import using slapadd:

slapadd -F /etc/ldap/slapd.d -n 1 -l ldap.domain.com.ldif

I can't restore my backup this way because of the operational attributes.

I have errors for example:

structuralObjectClass: no user modification allowed

It's possible to make a backup without operational attributes or import somehow with them?


Taken from http://www.openldap.org/lists/openldap-software/200504/msg00195.html

You are not allowed to change these as they are internal.

Either remove them from your LDIF or use the -c switch (dangerous).

slapadd -F /etc/ldap/slapd.d -n 1 -c -l ldap.domain.com.ldif

As for not writing them in the first place, pipe the output through egrep to trim them:

slapcat -n 1 | egrep -v  "^(structuralObjectClass|entryUUID|creatorsName|modifiersName|createTimestamp|modifyTimestamp|entryCSN):" > ${BACKUP_PATH}/ldap.domain.com.ldif 

From http://vaab.blog.kal.fr/2010/03/10/import-export-ldap-database/

I consider this a bug in slapcat, at the very least, it should have an option to 'not' output this stuff.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.