I am trying to restore my OpenLDAP server from an ldif file I made before it went horribly wrong.
All of the websites I found talk about using slapadd
but when I run slapadd -v -l ~ns01/openldap_config.ldif
it returns the error Could not stat config file "/etc/ldap/slapd.conf" : No such file or directory (2) slapadd: bad configuration file!
When I look in the directory indeed the file does not exist, but this is because Ubuntu 11.10 is running in RTC mode, my LDAP server uses the /etc/slapd.d/cn=config
for the configuration. So? What am I missing? Is slapadd
the wrong tool to use?
As I said above I running on Ubuntu 11.10 server edition 64-bit.
Looking through the documentation it looks as if you may be able to use the
-F
flag toslapadd
to specify a configuration directory, rather than a configuration file:If this doesn't work (e.g., you're missing the contents of your cn=config tree), possibly this thread has some suggestions.
Try this:
Should work for Ubuntu 11.10, although I'm still exploring this new
cn=config
stuff.I've used this:
ldapadd -c -x -H ldap://localhost:389 -D "dc=Manager,dc=example,dc=com" -w password -f /tmp/backup.ldif
Modified from https://github.com/gschueler/vagrant-rundeck-ldap/blob/master/load-ldif.sh