View Single Post
  #15 (permalink)  
Old 01-19-2009, 08:27 PM
ipguru99 ipguru99 is offline
Active Member
 
Posts: 32
Default 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!

Last edited by ipguru99; 02-14-2009 at 04:06 PM.. Reason: sleep deprivation -- customer did it again and I had to look at this.. and I couldn't even figure out what I wrote..
Reply With Quote