How do you recover from a zimbra crash?

Solution 1:

From the errors you've posted it looks as if the databased used by slapd, the LDAP server, has become corrupt. There are a number of things you can try. First, make a backup of your data even though its corrupt! Some of the suggestions here may modify the database files and preclude alternate recovery suggestions.

NB: I know nothing about Zimbra, but I've worked with OpenLDAP quite a bit. There may be Zimbra-specific things you should be doing that I know nothing about.

The easiest would be to simply restore your database from backups. I'm not familiar with Zimbra in particular, but most applications that integrate tightly with an LDAP backend include some form of periodic dump of the database to LDIF records. If you have such a backup, you can probably remove everything in your /opt/zimbra/data/ldap/hdb/db/ (SAVE IT FIRST!) and re-import from your backups. This procedure is probably described somewhere in the documentation.

If the db_recover tool is available on your system (this is a BerkeleyDB maintenance tool), you can see if the database is recoverable. Change to /opt/zimbra/data/ldap/hdb/db/, and then run db_recover -v -h .. This may or may solve anything. If Zimbra uses OpenLDAP more recent than 2.2 (e.g., 2.3.x or later), this should happen automatically.