Topic: LDAP bdb backend system update (with yum) warning
During a system upgrade on a CentOS 6 box with
yum upgrade
slapd refused to start after upgrading.
I want to put a word of warning before doing a system upgrade. Be sure that you first stop all system services like postfix, dovecot, ... before starting the system upgrade as it turned out after upgrading that the ldap backend database was corrupt.
slapd showed the following problem when started on commandline with:
slapd -d 1 -f /etc/openldap/slapd.conf
the following problem:
bdb(dc=xxx,dc=xxx): Program version 4.7 doesn't match environment version 4.8
and slapd refuses to start.
My first thought was to check the Berkeley DB database version, as version 4.8 already exists but not yet officially in packaged form for CentOS 6.The OpenLDAP database stores its data in a BDB database located in /var/lib/ldap/xxx.xxx. There you find all bdb files of the LDAP database.
However, after several hours debugging, I decided to install another CentOS + iRedmail box and try the bdb database on that machine. The newly installed machine showed the same error on the database, so it turned out that the database was corrupt.
I finally recovered the data with (first go to the /var/lib/ldap/xxx.xxx directory):
db_dump -f yyy.bdb > yyy
and do this for every bdb file in the directory.
To restore the data, you can use:
db_load -f yyy yyy.bdb
remove all __db.* files, log.* files, the alock file and restart slapd.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.