I have now run db_recover and I still get the same error with id2entry.bdb.
I am now trying to follow instructions from
[SOLVED] LDAP / slapd - Database environment corrupt (Issue & Solution).
I do not, however, seem to have a /opt/zimvbra/conf/slapd.conf file. There is some kind of default file in /opt/zimbra/openldap-2.4.23.2z/etc/openldap/slapd.conf, but when I try ~/openldap/sbin/slapadd -w -q -f ~/openldap-2.4.23.2z/etc/openldap/slapd.conf -l ../ldap.bak, I get:
Unrecognized database type (bdb)
/opt/zimbra/openldap-2.4.23.2z/etc/openldap/slapd.conf: line 53: <database> failed init (bdb)
slapadd: bad configuration file!
I suspect the missing ~/conf/slapd.conf is a problem. How can I recreate this file?