Hi @All,
now while my ldapserver is working on my testmachine, i'am trying to import my ldif files.
I read the thread http://www.openldap.org/lists/openldap-software/200711/msg00069.html
but the import isn't working for me.
abirndt@lvps83-169-33-218:~/openldap_2axels-company$ sudo slapadd -F /etc/ldap/slapd.d -n 0 -l dc_2axels-company_dc_de_export.ldif slapadd: line 1: database (cn=config) not configured to hold "dc=2axels-company,dc=de" slapadd: line 1: database (cn=config) not configured to hold "dc=2axels-company,dc=de" abirndt@lvps83-169-33-218:~/openldap_2axels-company$ sudo slapadd -F /etc/ldap/slapd.d -n 0 -l cn_config_export.ldif
I created my backupfiles with the following commands:
sudo slapcat -b cn=config -F /etc/ldap/slapd.d/ >cn_Config_export.ldif
sudo slapcat -b dc=2axels-company,dc=de -F /etc/ldap/slapd.d/
dc_2axels-company_dc_de_export.ldif
I'am also looking in google for solving this, but in my mind i haven't the right keywords...
Could anyone give me a hint or a link for reading, how to import the created ldif files from above to a new ldap-server?
--On Thursday, December 01, 2011 10:38 PM +0100 Axel Birndt towerlexa@gmx.de wrote:
Hi @All,
now while my ldapserver is working on my testmachine, i'am trying to import my ldif files.
I read the thread http://www.openldap.org/lists/openldap-software/200711/msg00069.html
but the import isn't working for me.
I'm not surprised. See why below:
abirndt@lvps83-169-33-218:~/openldap_2axels-company$ sudo slapadd -F /etc/ldap/slapd.d -n 0 -l dc_2axels-company_dc_de_export.ldif slapadd: line 1: database (cn=config) not configured to hold "dc=2axels-company,dc=de" slapadd: line 1: database (cn=config) not configured to hold "dc=2axels-company,dc=de" abirndt@lvps83-169-33-218:~/openldap_2axels-company$ sudo slapadd -F /etc/ldap/slapd.d -n 0 -l cn_config_export.ldif
I created my backupfiles with the following commands:
sudo slapcat -b cn=config -F /etc/ldap/slapd.d/ >cn_Config_export.ldif
sudo slapcat -b dc=2axels-company,dc=de -F /etc/ldap/slapd.d/
dc_2axels-company_dc_de_export.ldif
So you exported your primary (NOT CONFIG) database into dc_2axels-company_dc_de_export.ldif.
You exported your config database into cn_Config_export.ldif
Yet you are trying to *slapadd* your primary database into the cn=config database. Why are you surprised this doesn't work?
Also, you need to import the config first. So your first slapadd command should be:
sudo slapadd -F /etc/ldap/slapd.d -n 0 -l cn_config_export.ldif
to import the config database.
Then you need to import your primary db:
sudo slapadd -F /etc/ldap/slapd.d -b "dc=2axels-company,dc=de" -l dc_2axels-company_dc_de_export.ldif
For slapadd, -n 0 has very specific meaning -- It is for the cn=config db only.
--Quanah
--
Quanah Gibson-Mount Sr. Member of Technical Staff Zimbra, Inc A Division of VMware, Inc. -------------------- Zimbra :: the leader in open source messaging and collaboration
Good Morning Quanah,
thanks for your fast answer. I tried it yesterday, but not with this exact command from you.... but unfortunately it doesnt work.
Am 01.12.2011 22:58, schrieb Quanah Gibson-Mount:
--On Thursday, December 01, 2011 10:38 PM +0100 Axel Birndt towerlexa@gmx.de wrote:
Yet you are trying to *slapadd* your primary database into the cn=config database. Why are you surprised this doesn't work?
Also, you need to import the config first. So your first slapadd command should be:
sudo slapadd -F /etc/ldap/slapd.d -n 0 -l cn_config_export.ldif
This fails with the following error:
abirndt@lvps83-169-33-218:~/openldap_2axels-company$ sudo slapadd -F /etc/ldap/slapd.d -n 0 -l cn_config_export.ldif [sudo] password for abirndt: slapadd: could not add entry dn="cn=config" (line=1):
But how could i add the initial import from the cn=config informations? Yesterday i spend some hours in googling for that, but don't find the correct solution...
to import the config database.
Then you need to import your primary db:
sudo slapadd -F /etc/ldap/slapd.d -b "dc=2axels-company,dc=de" -l dc_2axels-company_dc_de_export.ldif
But this second command seems to be working. I will check it soon.
For slapadd, -n 0 has very specific meaning -- It is for the cn=config db only.
Ok thanks for this hint. While you read in my other mails, you know, that i'am currently a beginner in openldap, and i don't read in the man-Page (-> sorry ;-) )
--On Friday, December 02, 2011 8:59 AM +0100 Axel Birndt towerlexa@gmx.de wrote:
Good Morning Quanah,
thanks for your fast answer. I tried it yesterday, but not with this exact command from you.... but unfortunately it doesn't work.
Am 01.12.2011 22:58, schrieb Quanah Gibson-Mount:
--On Thursday, December 01, 2011 10:38 PM +0100 Axel Birndt towerlexa@gmx.de wrote:
Yet you are trying to *slapadd* your primary database into the cn=config database. Why are you surprised this doesn't work?
Also, you need to import the config first. So your first slapadd command should be:
sudo slapadd -F /etc/ldap/slapd.d -n 0 -l cn_config_export.ldif
This fails with the following error:
abirndt@lvps83-169-33-218:~/openldap_2axels-company$ sudo slapadd -F /etc/ldap/slapd.d -n 0 -l cn_config_export.ldif [sudo] password for abirndt: slapadd: could not add entry dn="cn=config" (line=1):
But how could i add the initial import from the cn=config informations? Yesterday i spend some hours in googling for that, but don't find the correct solution...
Did you remove the old config database from /etc/ldap/slapd.d? If there is already a config database existing, it will fail to overwrite it. The fact that the second slapadd succeeds strongly indicates you did not get rid of the old cn=config db.
--Quanah
--
Quanah Gibson-Mount Sr. Member of Technical Staff Zimbra, Inc A Division of VMware, Inc. -------------------- Zimbra :: the leader in open source messaging and collaboration
Hi Quanah,
thank you many times for your help and your time.
It is working now.
Am 02.12.2011 13:50, schrieb Quanah Gibson-Mount:
--On Friday, December 02, 2011 8:59 AM +0100 Axel Birndt towerlexa@gmx.de wrote:
sudo slapadd -F /etc/ldap/slapd.d -n 0 -l cn_config_export.ldif [sudo] password for abirndt: slapadd: could not add entry dn="cn=config" (line=1):
But how could i add the initial import from the cn=config informations? Yesterday i spend some hours in googling for that, but don't find the correct solution...
For all others here is a link which describe it like your way:
http://www.linid.org/projects/linid-om/wiki#OpenLDAP-Manager
Did you remove the old config database from /etc/ldap/slapd.d? If there is already a config database existing, it will fail to overwrite it. The fact that the second slapadd succeeds strongly indicates you did not get rid of the old cn=config db.
Great, thank you. I forgot to remove the content from /etc/ldap/slapd.d!
now my steps which are working:
1. stop slapd 2. remove content from /etc/ldap/slapd.d 3. sudo slapadd -F /etc/ldap/slapd.d -n 0 -l cn_Config_export.ldif 4. start ldapserver
I'am happy, while all my acl's are still in the ldapserver, and all is working.
The best knowledge is, that i'am now be able to restore my ldap server from a backup.
I wish you a nice weekend!
openldap-technical@openldap.org