Erwann Abalea wrote:
I think that even in the cn=config case, a stop/start is necessary, because database can't be deleted, and I doubt a backend change can be performed dynamically. Maybe even some manual LDIF editing is necessary, something evil ;)
You can get the new database running, dynamically. Since the new backend is a different structural objectclass, no, you can't just modify the existing olcDatabase entry.
I would create a new slapd.d for slapadd'ing the new database. Then when it's complete, ldapmodify the running slapd to add the MDB database and disable the existing database. Something like:
### dn: olcDatabase=mdb,cn=config changetype: add ... olcSuffix: o=temporary ...
dn: olcDatabase={1}hdb,cn=config changetype: modify replace: olcDbDirectory olcDbDirectory: /tmp/dummy - replace: olcSuffix olcSuffix: o=unused -
dn: olcDatabase=mdb,cn=config changetype: modify replace: olcSuffix olcSuffix: dc=the,dc=suffix -
###
Add the MDB database with a fake suffix first, then turn off the BDB/HDB database and set it to a dummy suffix, then put the real suffix onto the MDB database.
Pointing the BDB/HDB backend at an empty directory will close the current DB, freeing up all of its resources. There is a window of maybe a few microseconds between switching the suffix on the old database and switching it on the new database where clients might get No Such Object errors on their queries. If we ever get around to implementing LDAP Transaction support for cn=config, then the whole thing can be done atomically/transparently.
The slapd.d that was used for the MDB slapadd can be discarded afterward.