Score:1

How can I delete the root node of a LDAP tree?

cn flag

I would like to restore a LDAP tree with slapadd from a backup generated with slapcat. When I load the backup on a freshly installed OpenLDAP instance, slapadd complains about the root node already existing. I know about the slapadd -c option that continues on errors, but I would like to do things properly and not generate false negatives.

So before I call slapadd I would like to delete the root node:

ldapdelete -W -x -H ldapi:/// -D cn=admin,dc=mydomain,dc=tld "dc=mydomain,dc=tld"
Enter LDAP Password:
ldap_delete: No such object (32)

What am I doing wrong with this command? Is there an alternative?

kr flag
Have you considered not trying to restore the root node / deleting the root node from the backup? As I recall, an LDAP backup is something like LDIF, which is often largely represented as ascii text and quite editable. (It has been quite a while though).
cn flag
This is conceivable. This backup/restore context is fully automatized so I would like to stick to simple commands, but I suppose editing a ldif is simple enough.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.