<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pt-BR">
	<id>https://wiki.slacam.com.br/index.php?action=history&amp;feed=atom&amp;title=Crash_Recovery_Zimbra</id>
	<title>Crash Recovery Zimbra - Histórico de revisão</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.slacam.com.br/index.php?action=history&amp;feed=atom&amp;title=Crash_Recovery_Zimbra"/>
	<link rel="alternate" type="text/html" href="https://wiki.slacam.com.br/index.php?title=Crash_Recovery_Zimbra&amp;action=history"/>
	<updated>2026-11-17T00:50:00Z</updated>
	<subtitle>Histórico de revisões para esta página neste wiki</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.slacam.com.br/index.php?title=Crash_Recovery_Zimbra&amp;diff=727&amp;oldid=prev</id>
		<title>Felipe em 11h07min de 19 de dezembro de 2013</title>
		<link rel="alternate" type="text/html" href="https://wiki.slacam.com.br/index.php?title=Crash_Recovery_Zimbra&amp;diff=727&amp;oldid=prev"/>
		<updated>2013-12-19T11:07:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pt-BR&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Edição anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Edição das 11h07min de 19 de dezembro de 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Linha 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linha 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;ads media=goo5/&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;amp;nbsp;  &lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;amp;nbsp;  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l30&quot; &gt;Linha 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linha 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;origin -&amp;amp;nbsp;[http://blog.tcg.com/tcg/2011/07/emergency-recovery-of-zimbras-openldap.html http://blog.tcg.com/tcg/2011/07/emergency-recovery-of-zimbras-openldap.html]&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;origin -&amp;amp;nbsp;[http://blog.tcg.com/tcg/2011/07/emergency-recovery-of-zimbras-openldap.html http://blog.tcg.com/tcg/2011/07/emergency-recovery-of-zimbras-openldap.html]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;ads media=goo3/&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Felipe</name></author>
	</entry>
	<entry>
		<id>https://wiki.slacam.com.br/index.php?title=Crash_Recovery_Zimbra&amp;diff=458&amp;oldid=prev</id>
		<title>Machado: Criou página com &#039;&amp;nbsp;   === Emergency Recovery of Zimbra&#039;s OpenLDAP  === &lt;div class=&quot;entry-content&quot; style=&quot;position: static; clear: both; margin: 10px 0px; font-family: Verdana, Arial, Helvetic…&#039;</title>
		<link rel="alternate" type="text/html" href="https://wiki.slacam.com.br/index.php?title=Crash_Recovery_Zimbra&amp;diff=458&amp;oldid=prev"/>
		<updated>2013-07-01T02:41:50Z</updated>

		<summary type="html">&lt;p&gt;Criou página com &amp;#039;    === Emergency Recovery of Zimbra&amp;#039;s OpenLDAP  === &amp;lt;div class=&amp;quot;entry-content&amp;quot; style=&amp;quot;position: static; clear: both; margin: 10px 0px; font-family: Verdana, Arial, Helvetic…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
=== Emergency Recovery of Zimbra&amp;#039;s OpenLDAP  ===&lt;br /&gt;
&amp;lt;div class=&amp;quot;entry-content&amp;quot; style=&amp;quot;position: static; clear: both; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 17px; padding-bottom: 15px; color: rgb(51, 51, 51);&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;entry-body&amp;quot; style=&amp;quot;clear: both;&amp;quot;&amp;gt;&lt;br /&gt;
Last weekend (July 3rd, 2011), Washington had a tremendous thunderstorm, which led to a long power outage. &amp;amp;nbsp;We have a number of experimental and development virtual machines in our local server farm that were impacted, but what was truly hit hard was an instance of&amp;amp;nbsp;[http://www.zimbra.com/ Zimbra]&amp;amp;nbsp;(an excellent email and collaboration environment) that we use to support some public outreach programs (such as the&amp;amp;nbsp;[http://thengp.org/ NGP]). &lt;br /&gt;
&lt;br /&gt;
Zimbra uses OpenLDAP, which in turn is based upon&amp;amp;nbsp;[http://www.oracle.com/technetwork/database/berkeleydb/overview/index.html Berkley DB]&amp;amp;nbsp;(now maintained by Oracle). &amp;amp;nbsp;BDB is open, simple, fast, and powerful, but has a tendancy to&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;really dislike&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;power failures. &amp;amp;nbsp;BDB uses a transaction log system (with names like &amp;quot;log.0000000001&amp;quot;) that will render the database unusable if inadvertaintly deleted. &amp;amp;nbsp;On the other hand, the logs ensure the validity of the database transactions. &amp;amp;nbsp;So what do you do if your Zimbra instance doesn&amp;#039;t come up, and by looking at /var/log/zimbra.log you realize that the ldap server is to blame (with &amp;quot;bdb()&amp;quot; errors)? &lt;br /&gt;
&lt;br /&gt;
First, know that you are not alone: BDB recovery is so common that they have a &amp;quot;db_recover&amp;quot; commnand. &lt;br /&gt;
&lt;br /&gt;
As root run: &lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;margin-top: 10px; margin-bottom: 10px;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;/etc/init.d/zimbra stop&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;cd /opt/zimbra/data/ldap/hdb/db/&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;/opt/zimbra/bdb-4.7.25.4/bin/db_recover -v&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;/opt/zimbra/libexec/zmfixperms --extended&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;/etc/init.d/zimbra start&amp;lt;/span&amp;gt; &amp;lt;/blockquote&amp;gt; &lt;br /&gt;
If that doesn&amp;#039;t work, db_recover has a &amp;quot;catastrophic&amp;quot; mode: &lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;margin-top: 10px; margin-bottom: 10px;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;/opt/zimbra/bdb-4.7.25.4/bin/db_recover -cv&amp;lt;/span&amp;gt; &amp;lt;/blockquote&amp;gt; &lt;br /&gt;
However, if &amp;quot;catastrophic&amp;quot; mode returns errors like: &lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;margin-top: 10px; margin-bottom: 10px;&amp;quot;&amp;gt;db_recover: Commonly caused by moving a database from one database environment&amp;lt;br&amp;gt;db_recover: to another without clearing the database LSNs, or by removing all of&amp;lt;br&amp;gt;db_recover: the log files from a database environment &amp;lt;/blockquote&amp;gt; &lt;br /&gt;
then to get the logs happy, you may need to dump and re-import some specific databases (typically the id2entry.bdb file which is very active): &lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;margin-top: 10px; margin-bottom: 10px;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;cd /opt/zimbra/data/ldap/hdb/db/&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;/opt/zimbra/bdb/bin/db_dump id2entry.bdb &amp;amp;gt; foo.txt&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;cp id2entry.bdb id2entry.bdb.bak&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;cat foo.txt | /opt/zimbra/bdb/bin/db_load id2entry.bdb&amp;lt;/span&amp;gt; &amp;lt;/blockquote&amp;gt; &lt;br /&gt;
With all of this, I was able to get LDAP (slapd) up and running. &amp;amp;nbsp;Oddly enough, after a couple of minutes slapd would PANIC (using that word in zimbra.log) and shutting down with a BDB inconsistency. &amp;amp;nbsp;Fortunately because I was able to get it to run for a couple of minutes, I used that time to perform a full LDAP dump and restore. &amp;amp;nbsp;In addition, this is a great way to conduct periodic backups of LDAP to speed recovery in the future (so if you are running the community version of Zimbra, add the backup command to a cron job!). &amp;amp;nbsp;To create a live dump of LDAP while it is running, run: &lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;margin-top: 10px; margin-bottom: 10px;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;su - zimbra&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;/opt/zimbra/libexec/zmslapcat /opt/zimbra/backup&amp;lt;/span&amp;gt; &amp;lt;/blockquote&amp;gt; &lt;br /&gt;
Then, to restore (or fully reconstruct) the LDAP database: &lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;margin-top: 10px; margin-bottom: 10px;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;su - zimbra&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;# stop zimbra&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;zmcontrol stop&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;# Make the DB directories&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;mv /opt/zimbra/data/ldap/hdb /opt/zimbra/data/ldap/hdb.old&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;mkdir /opt/zimbra/data/ldap/hdb&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;mkdir -p /opt/zimbra/data/ldap/hdb/db \&lt;br /&gt;
&amp;amp;nbsp;/opt/zimbra/data/ldap/hdb/logs&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;cp /opt/zimbra/data/ldap/hdb.old/db/DB_CONFIG \&lt;br /&gt;
&amp;amp;nbsp;/opt/zimbra/data/ldap/hdb/db/DB_CONFIG&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;# Restore the backup you made to create a nice and clean BDB set&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;/opt/zimbra/openldap/sbin/slapadd -q -b &amp;quot;&amp;quot; -F \&lt;br /&gt;
&amp;amp;nbsp;/opt/zimbra/data/ldap/config -cv -l /opt/zimbra/backup/ldap.bak&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;# Start zimbra&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-family: &amp;#039;courier new&amp;#039;, courier;&amp;quot;&amp;gt;zmcontrol start&amp;lt;/span&amp;gt; &amp;lt;/blockquote&amp;gt; &lt;br /&gt;
Once I performed this step of backup and recovery, LDAP finally behaved correctly. &lt;br /&gt;
&lt;br /&gt;
I hope this saves you time (and stress)! &lt;br /&gt;
&lt;br /&gt;
origin -&amp;amp;nbsp;[http://blog.tcg.com/tcg/2011/07/emergency-recovery-of-zimbras-openldap.html http://blog.tcg.com/tcg/2011/07/emergency-recovery-of-zimbras-openldap.html]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Machado</name></author>
	</entry>
</feed>