Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-20-2009, 02:32 PM
Intermediate Member
 
Posts: 18
Default [SOLVED] Need a hand - Crashed Zimbra server

I really am in a pickle here. The automated cron backup jobs that I configured backed up nothing. I *think* that I can grab the old zimbra ldap and message store files. I have already loaded a different box with ZCS. What do I need to do to import the old message stores? I can really care less right now about user accounts. I only had 7 users. What I need is the old mail. I cannot seem to find the actual database files for Zimbra. It would be really nice to just be able to take the old message store area and recover it.

And for the curious. I had 2 hard drives in a RAID 1 mirror. Both drives failed at almost the same time. I'm having a bad day! :>


Any ideas? Help?
Reply With Quote
  #2 (permalink)  
Old 02-20-2009, 05:44 PM
Active Member
 
Posts: 39
Default

I'm not a Zimbra expert but here is what I would do. If you have the mySQL database files and the store files then just create the accounts on the new zimbra server and import the old data by hand. Even better would be if you had the ldap data.

Otherwise if you just have the store files then you are in for some fun. The messages are stored just as numbers with the mappings for each in the mySQL databases.

Figure out what numbered folder goes with each account under /opt/zimbra/store. Then in Winodws use Outlook Express to add each IMAP account. Rename the .msg files from the store folder to .eml. Drag-drop the .eml files into the appropriate accounts in Outlook Express.

The only issue is you won't know what messages go in which folders. You can figure out the Sent from the Inbox by looking at the To: or From: address.
Reply With Quote
  #3 (permalink)  
Old 02-20-2009, 05:59 PM
Intermediate Member
 
Posts: 18
Default

Thank god someone answered me. I'm soo fired.

Do you know where i would find the ldap info?? I might have it. I can access the whole zimbra folder. If I have the ldap info and store, can I import into a new version of ZCS or do I need to use the exact version it came from?

Can I just dump it over the top of a "like" installation?

Any help is mucho appreciated!
Reply With Quote
  #4 (permalink)  
Old 02-20-2009, 06:03 PM
Active Member
 
Posts: 39
Default

Quote:
Originally Posted by icepick94 View Post
Thank god someone answered me. I'm soo fired.

Do you know where i would find the ldap info?? I might have it. I can access the whole zimbra folder. If I have the ldap info and store, can I import into a new version of ZCS or do I need to use the exact version it came from?

Can I just dump it over the top of a "like" installation?

Any help is mucho appreciated!
There is more to it than just the ldap info and store. You need the mySQL data which is critical as it stores the mapping for store.

If you can access the entire zimbra folder I would make a backup first. Then just copy that to the new system and install zimbra over top. I would assume that would work like an upgrade and it should just work.
Reply With Quote
  #5 (permalink)  
Old 02-20-2009, 07:16 PM
Intermediate Member
 
Posts: 18
Default

I will definitely try that. But the drive is trashed. I'm lucky to have the message store.

I found this post (http://www.zimbra.com/forums/adminis...ect-print.html) that tells me how to use zmlmtpinject to inject the messages into the new server/user folder. It even had a little script to run that would put the date in the header so you could sort the imported mail by date.

Hopefully that will save my bacon. I was able to save all of the main people's sent items to an Outlook PST before the server really took a dump.

Thanks a MILLION for answering. We'll see how this goes. It been on hell of day so far!
Reply With Quote
  #6 (permalink)  
Old 02-20-2009, 07:25 PM
Intermediate Member
 
Posts: 18
Default

Does anyone have a nice little script that will change all the file's extensions in a folder from .msg to .eml? That would help a lot as well!
Reply With Quote
  #7 (permalink)  
Old 02-20-2009, 08:41 PM
Active Member
 
Posts: 39
Default

Quote:
Originally Posted by icepick94 View Post
Does anyone have a nice little script that will change all the file's extensions in a folder from .msg to .eml? That would help a lot as well!
Code:
for i in *.msg; do mv $i `echo $i | sed 's/msg/eml/g'`; done
Reply With Quote
  #8 (permalink)  
Old 02-20-2009, 08:47 PM
Active Member
 
Posts: 39
Default

Quote:
Originally Posted by icepick94 View Post
Thanks a MILLION for answering. We'll see how this goes. It been on hell of day so far!
Glad I could be of some help. If you want to test a few different scenarios you might load VMware server on a spare machine. Create a virtual machine, load the OS and take a snapshot. Then you can try a restore option, if it doesn't work you can quickly revert to a clean OS install and try again.
Reply With Quote
  #9 (permalink)  
Old 02-21-2009, 04:41 AM
Intermediate Member
 
Posts: 18
Default

I gotta hand it to you.. THANKS!!

I was able to change the extensions of all the mail in the message store. Then I used *cough**hack**weeze* Vista mail. I was able to block like 500 messages at a time and drag them into Vista mail. When I did that, they came up in order, date tags, to, and from: all in order!

From that point it was easy to separate the mail and export it out to Outlook. I am now uploading back into the Zimbra server via IMAP.

Thanks sooooo much for the info. It really saved me a lot of grief!
Reply With Quote
  #10 (permalink)  
Old 02-21-2009, 05:23 AM
Active Member
 
Posts: 39
Default

Your welcome! Glad to hear you didn't end up loosing anything. Sounds like it was a long night. Hopefully there wasn't an easier way that I didn't know of.

If you're running a 5.0.9+ version you might try my backup script. I based it off the ZCS-to-ZCS Migrations article. It mounts an NFS share and backs up each account. However you could easily change the line to mount a SMB share on a Windows machine.

To import to a new server you would have to manually create the new accounts and then run the following for each account. I have tested this and it works great and is simple.

Code:
/opt/zimbra/bin/zmmailbox -z -m user@domain.com postRestURL “//?fmt=tgz&resolve=reset” account.tgz

Here's the script. Save it to a file and give it execute permissions.
Code:
#!/bin/bash

nfs_mount=mrkrabs:/data/Backup/Cliff
mount_dir=/mnt/backup
zimbra_bin=/opt/zimbra/bin

echo "Zimbra Mailbox Backup"

if [ -d /mnt/backup ]; then
    echo "Mount point exists, exiting"
    exit
fi

mkdir ${mount_dir}
mount ${nfs_mount} ${mount_dir}

if [ $? -ne 0 ]; then
    echo "NFS mount failed, exiting"
fi

date=`/bin/date +%Y%m%d`
all_account=`${zimbra_bin}/zmprov gaa`

for account in ${all_account}; do
    mb_size=`${zimbra_bin}/zmmailbox -z -m ${account} gms`
    echo "Backing up ${account} (${mb_size})"
    ${zimbra_bin}/zmmailbox -z -m ${account} getRestURL "//?fmt=tgz" > ${mount_dir}/${date}-${account}.tgz
done

umount ${mount_dir}
rmdir ${mount_dir}

echo "Completed"
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.