Another issue spotted while converting from HDB on Debian 11 to MDB on Debian 12, I had to remove manually /etc/ldap/slapd.d/cn=config/olcBackend={0}hdb.ldif after running the script. On Debian 12 this file prevents slapd from starting.
dn: olcBackend={0}hdb
objectClass: olcBackendConfig
olcBackend: {0}hdb
structuralObjectClass: olcBackendConfig
entryUUID: 486c82f2-5217-1030-9e09-09781a3cc679
creatorsName: cn=admin,cn=config
createTimestamp: 20110803122430Z
entryCSN: 20110803122430.990789Z#000003#000#000000
modifiersName: cn=admin,cn=config
modifyTimestamp: 20110803122430Z
Another issue spotted while converting from HDB on Debian 11 to MDB on Debian 12, I had to remove manually
/etc/ldap/slapd.d/cn=config/olcBackend={0}hdb.ldifafter running the script. On Debian 12 this file prevents slapd from starting.