Results 1 to 10 of 10

Thread: [SOLVED] Need a hand - Crashed Zimbra server

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Posts
    18
    Rep Power
    7

    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?

  2. #2
    Join Date
    Feb 2009
    Posts
    41
    Rep Power
    6

    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.

  3. #3
    Join Date
    Sep 2008
    Posts
    18
    Rep Power
    7

    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!

  4. #4
    Join Date
    Feb 2009
    Posts
    41
    Rep Power
    6

    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.

  5. #5
    Join Date
    Sep 2008
    Posts
    18
    Rep Power
    7

    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!

  6. #6
    Join Date
    Feb 2009
    Posts
    41
    Rep Power
    6

    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.

  7. #7
    Join Date
    Sep 2008
    Posts
    18
    Rep Power
    7

    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!

  8. #8
    Join Date
    Feb 2009
    Posts
    41
    Rep Power
    6

    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

  9. #9
    Join Date
    Sep 2008
    Posts
    18
    Rep Power
    7

    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!

  10. #10
    Join Date
    Feb 2009
    Posts
    41
    Rep Power
    6

    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"

Similar Threads

  1. Zimbra spam system
    By rajahd in forum Administrators
    Replies: 9
    Last Post: 04-16-2008, 07:25 PM
  2. zmperditionctl start asking for password
    By k7sle in forum Administrators
    Replies: 32
    Last Post: 02-20-2008, 10:13 AM
  3. Cleanup after many upgrades
    By tobru in forum Installation
    Replies: 1
    Last Post: 12-23-2007, 08:21 AM
  4. Replies: 8
    Last Post: 02-27-2007, 03:10 AM
  5. Zimbra server crashed
    By goetzi in forum Administrators
    Replies: 6
    Last Post: 03-25-2006, 12:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •