Alberto Moreno
2017-Apr-11 19:44 UTC
[Samba] Migrating from Centos 5 NT4 style to Centos 7 issues
Hi. I want to move my current domain running centos 5 to centos 7. Samba3x ==>Samba4x openldap 2.3x==>2.4.x I move my ldap backup that I got from backups: slapcap -l mydomain.ldif Next move my config files to the new server: /etc/ldap.conf /etc/openldap/slapd.conf /etc/openldap/ldap.conf Schemas are correct. Copy DB_CONFIG that doesn't exist on openldap 2.4, to /var/lib/ldap/ Restore ldap backup. slapadd -l mydomain.ldif But I got this error: slapadd -l /opt/mydomain.ldap 58ecf8a3 The first database does not allow slapadd; using the first available one (2) slapadd: line 1: database #2 (dc=my-domain,dc=com) not configured to hold "dc=mydomain,dc=local"; no database configured for that naming context _ 0.10% eta none elapsed none spd 2.1 M/s Closing DB... Looks like I miss something? Thanks. -- LIving the dream...
Marc Muehlfeld
2017-Apr-11 20:16 UTC
[Samba] Migrating from Centos 5 NT4 style to Centos 7 issues
Hi Alberto, I currently don't have an OpenLDAP server running, but let's try it anyway. :-) Am 11.04.2017 um 21:44 schrieb Alberto Moreno via samba:> Next move my config files to the new server: > /etc/ldap.conf > /etc/openldap/slapd.conf > /etc/openldap/ldap.confCan you make sure that there is no /etc/openldap/slapd.d/ directory? If it exists, delete it - otherwise your slapd.conf is not used. You can later convert your slapd.conf into the directory-style configuration if you want.> Copy DB_CONFIG that doesn't exist on openldap 2.4, to /var/lib/ldap/* Does there anything exist in this directory? If yes, delete it. * Restore your DB_CONFIG file. * Start slapd to create the initial database files. * Stop slapd again. slapadd works offline.> Restore ldap backup. > > slapadd -l mydomain.ldifJust to make sure that the command uses your config: # slapadd -l mydomain.ldif -f /etc/openldap/slapd.conf> But I got this error: > > slapadd -l /opt/mydomain.ldap > 58ecf8a3 The first database does not allow slapadd; using the first > available one (2) > slapadd: line 1: database #2 (dc=my-domain,dc=com) not configured to hold > "dc=mydomain,dc=local"; no database configured for that naming context > _ 0.10% eta none elapsed none spd 2.1Do you have multiple databases configured in slapd.conf? If yes, temporarily remove the ones you don't need for the import. Other than that, if your slapd.conf isn't mixed with an existing slapd.d directory, it might help to see the slapd.conf If the previous hints do not help, you can send me an email off-list with your slapd.conf and an LDIF file that contains the a few top level entries. Then I can have a look tomorrow evening. Regards, Marc
Gaiseric Vandal
2017-Apr-11 20:50 UTC
[Samba] Migrating from Centos 5 NT4 style to Centos 7 issues
I vaguely remember some issue where openldap between versions went from using a single file for config to a multiple file config. I think you could use the slapcat command to convert. On 04/11/17 16:16, Marc Muehlfeld via samba wrote:> Hi Alberto, > > I currently don't have an OpenLDAP server running, but let's try it > anyway. :-) > > > Am 11.04.2017 um 21:44 schrieb Alberto Moreno via samba: >> Next move my config files to the new server: >> /etc/ldap.conf >> /etc/openldap/slapd.conf >> /etc/openldap/ldap.conf > > Can you make sure that there is no /etc/openldap/slapd.d/ directory? > If it exists, delete it - otherwise your slapd.conf is not used. You > can later convert your slapd.conf into the directory-style > configuration if you want. > > > >> Copy DB_CONFIG that doesn't exist on openldap 2.4, to /var/lib/ldap/ > > * Does there anything exist in this directory? If yes, delete it. > * Restore your DB_CONFIG file. > * Start slapd to create the initial database files. > * Stop slapd again. slapadd works offline. > > > > >> Restore ldap backup. >> >> slapadd -l mydomain.ldif > > Just to make sure that the command uses your config: > # slapadd -l mydomain.ldif -f /etc/openldap/slapd.conf > > > >> But I got this error: >> >> slapadd -l /opt/mydomain.ldap >> 58ecf8a3 The first database does not allow slapadd; using the first >> available one (2) >> slapadd: line 1: database #2 (dc=my-domain,dc=com) not configured to >> hold >> "dc=mydomain,dc=local"; no database configured for that naming context >> _ 0.10% eta none elapsed none >> spd 2.1 > > Do you have multiple databases configured in slapd.conf? If yes, > temporarily remove the ones you don't need for the import. > > Other than that, if your slapd.conf isn't mixed with an existing > slapd.d directory, it might help to see the slapd.conf > > If the previous hints do not help, you can send me an email off-list > with your slapd.conf and an LDIF file that contains the a few top > level entries. Then I can have a look tomorrow evening. > > > Regards, > Marc >