While copying some ldap databases to another environment I faced several issues, here I’ll leave a list of useful things to do/check everytime we need to perform this kind of task.

Because I’m working with LDAP 2.4 you’ll notice that I’m using the new “DIT” format (cn=config) instead of the deprecated “.conf” files, you can learn alot about the basics just reading this article on Digital Ocean.

Fast Procedure

  • Copy the whole configuration into the new server (usually from) /etc/openldap
  • Copy all the ldap information into the new server, databases, logs, etc.. (usually from) /var/lib/ldap

Fixing errors

Errors while configuring

ldap_read: want=8 error=Resource temporarily unavailable

bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found

Fix

Start Openldap with a higher debugging level:

I saw this line in the output (this is how I knew that I needed to add the “people” schema:

It’s possible you need to add some schemas into your database. In my case after deleting everything from /var/lib/ldap to have a fresh start I needed to add this (in example):

This is the content of first_items.ldif

Errors after running the service

This happened because a log filled my / to 100%, after freeing some space the ldap service worked fine.