Forums saved my ldap after power loss!
I just keep having customers do 'customer' stuff... and then I visit the forums to figure out what they have 'customer'd' up! This was also a power loss. I followed everything and this is what happened..
1. # su - zimbra
2. $ ldap stop
3. $ cd /opt/zimbra/openldap-data
4. $ /opt/zimbra/sleepycat/bin/db_recover
... Still get all the Panic stuff
Then...
1. # su - zimbra
2. $ ldap stop
3. $ exit
4. # mv /opt/zimbra/openldap-data /opt/zimbra/openldap-01-19-2009-crash
5. # mkdir /opt/zimbra/openldap-data
6. # cp /opt/zimbra/openldap-data-01-19-2009-crash/DB_CONFIG /opt/zimbra/openldap-data/DB_CONFIG
7. # chown -R zimbra:zimbra /opt/zimbra/openldap-data
8. # su - zimbra
9. $ ~/openldap/sbin/slapadd -w -q -f ~/conf/slapd.conf -l /opt/zimbra/backup/sessions/incr-20090118.xx.x.x.x.x./ldap.bak
10. $ ~/openldap/sbin/slapindex -f ~/conf/slapd.conf
11. $ ldap start
This still didn't work..
So, now that I know exactly where the backup stuff is (because of step 9) and thinking that I was not far away from having to copy that backup data and wipe this box, I copied the stuff in /opt/zimbra/backup/sessions/incr-20090118.xxx.xxx/ldap/ (file path was a little different from the example.. and I can't remember the version they were on). Basically, I copied the db directory (which was empty) from the crashed copy and I copied the logs dir from the crashed copy.. both went into the newly populated /opt/zimbra/openldap-data directory. I did number 7 again.. then I did the below
1. cd /opt/zimbra/openldap-data
2. e/opt/zimbra/sleepycat/bin/db_recover
Which is exactly what I did to begin with. Then...
zmcontrol start
.. and it worked...
So I basically made sure my old ldap-data directory was out of the way.. used these commands (lines 5-10) to get as much fresh.. get the rest from backups and it worked..
It was a little different than spelled out.. so I thought I would share.
Thanks to everyone that jumps in the forums and writes all this stuff down!
rebuild ldap data (in OSS edition?)
Dear all,
just read another article about DB recovery from :
http://www.zimbra.com/forums/adminis...-solution.html
and i'm wondering if these steps also work in open source edition, since it use the ldap.bak from NE edition's daily backup?
any advice on this? Thanks.
Code:
# su - zimbra
$ ldap stop
$ exit
# mv /opt/zimbra/openldap-data /opt/zimbra/openldap-data-0704-crash
# mkdir /opt/zimbra/openldap-data
# cp /opt/zimbra/openldap-data-0704-crash/DB_CONFIG /opt/zimbra/openldap-data/DB_CONFIG
# chown -R zimbra:zimbra /opt/zimbra/openldap-data
# su - zimbra
$ ~/openldap/sbin/slapadd -w -q -f ~/conf/slapd.conf -l /opt/zimbra/backup/ldap/incr-20070704.080005.554/ldap.bak
$ ~/openldap/sbin/slapindex -f ~/conf/slapd.conf
$ ldap start