Problem with LDAP after upgrade to Yunohost 2.4

After discussions with @jeremy54 and an access to his server, there could be a migration issue when upgrading to Debian Jessie.
To check if it’s your case, execute: slapcat. If it doesn’t return anything and if the folder /var/lib/ldap/ contains some files named __db.001, you seem to be concerned. The fact is that the LDAP backend changed from hdb to mdb in Debian Jessie but no database migration was done in YunoHost v2.2. Here is how to fix that:

  • Ensure that you’ve upgraded YunoHost to v2.4 and there is no pending package upgrade - a fix has just been released today.

  • Replace the LDAP backend to the old one to recover your database: sed -i 's/mdb/hdb/g' /etc/ldap/slapd.conf

  • See if the old database is loaded again by checking the output of: slapcat

    • If it still doesn’t return anything, execute the following commands:
rm -Rf /etc/ldap/slapd.d
mkdir /etc/ldap/slapd.d
slaptest -f /etc/ldap/slapd.conf -F /etc/ldap/slapd.d/ 2>&1
chown -R openldap:openldap /etc/ldap/slapd.d/
service slapd restart
  • Check again the output of: slapcat. If it’s still doesn’t return anything, there should be another issue…

  • Regenerate LDAP configuration and update the backend: yunohost service regen-conf slapd --verbose --force

  • Check if everything works well… by executing: slapcat!

2 Likes