OpenLDAP uses several backends to store its data. It is possible to use Berkeley DataBase (BDB) or HDB.
In some cases, such as the recent FreeBSD decision to use BDB version 5 by default instead of BDB version 4, OpenLDAP will not start anymore after the BDB update. If you use the slapcat command you will see the following output:
53ff62d3 bdb(dc=unix-experience,dc=fr): BDB1538 Program version 5.3 doesn't match environment version 4.6
53ff62d3 bdb_db_open: database "dc=unix-experience,dc=fr" cannot be opened, err -30969\. Restore from backup!
53ff62d3 backend_startup_one (type=bdb, suffix="dc=unix-experience,dc=fr"): bi_db_open failed! (-30969)
slap_startup failed
To perform the migration you need to keep a local copy of the old BDB binaries. Under FreeBSD, the old version can coexist alongside the new one.
Then go to the OpenLDAP data directory (under FreeBSD /var/db/openldap-data), and run the following commands:
db_checkpoint-4.6 -1
db_recover-4.6
db_recover-5.3 -e
Note: if you cannot have two BDB versions coexisting, run db_checkpoint -1 then db_recover, update BDB then run db_recover -e.