I have migrated my old slapd
DB to a new server, these are the steps I took:
On old server run:
slapcat -n 0 -l config.ldif slapcat -n 2 -l data.ldif
I had to run
slapcat -n 2
because with-n 1
I getslapcat: database doesn't support necessary operations.
Copy the two ldif files to new server
Install
openldap
:yum install -y openldap openldap-servers openldap-clients
Edit
config.ldif
and change the linesdn: olcDatabase={2}bdb,cn=config olcDatabase: {2}bdb
to be
dn: olcDatabase={1}bdb,cn=config olcDatabase: {1}bdb
Run
slapadd
for the two ldif files:slapadd -c -F /etc/openldap/slapd.d -n 0 -l config.ldif
First time round this gave me the error about
olcOverlay
not being allowed so I removed the line for theconfig.ldif
file then it worked ok.slapadd -c -F /etc/openldap/slapd.d -n 1 -l data.ldif
this appeared to work fine.
Start
slapd
. This is where my problem is,slapd
won't start and I get the error:olcDbDirectory: value #0: invalid path: Permission denied config error processing olcDatabase={1}bdb,cn=config: olcDbDirectory: value #0: invalid path: Permission denied
my
olcDbDirectory
in theconfig.ldif
file is set to/usr/local/openldap/ldap
and this folder exists and is owned byldap:ldap
and I've even tried giving it777
permissions but I still get this error.
I would expect slapd
to start. If anyone can give me any help it would be amazing, either steps I may have missed or what I should do to resolve this error.