Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Restoring part of a backup

  1. #1
    buee is offline Loyal Member
    Join Date
    Feb 2009
    Posts
    76
    Rep Power
    6

    Default Restoring part of a backup

    I'm using ZCS 5.0.16 open source on CentOS and I have made a script that will backup and tar the /opt/zimbra folder every week.

    I have a problem user on my Zimbra server and her latest gripe is that Zimbra magically deleted a whole months worth of e-mails. The other 20 active e-mail accounts have not reported this. I guess there are two parts to my question:

    1) Is there a way to restore that backup so that she gets the missing months e-mails back without creating duplicates and without deleting anything that's been received since (on any accounts)?

    2) Is there something specific I can look for in the logs to tell exactly what happened to those e-mails? I am somewhat of a Zimbra n00b and I would need to know which log to look at and what to look for.

    My guess is that it's an ID10T error but still, I want to know what happened exactly.

  2. #2
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,505
    Rep Power
    57

    Default

    If you have a backup of the store directory then you can use zmlmtpinject to put the records back into the mailbox. There are usually a couple of reasons mail goes 'missing' a) there's a filter that deletes mail b) there's been a connection using a POP3 client and the more likely c) the user actually deletes the mail themselves. Other than that and without log files it's almost impossible to tell you exactly what happened.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    buee is offline Loyal Member
    Join Date
    Feb 2009
    Posts
    76
    Rep Power
    6

    Default Understood

    Quote Originally Posted by phoenix View Post
    If you have a backup of the store directory then you can use zmlmtpinject to put the records back into the mailbox. There are usually a couple of reasons mail goes 'missing' a) there's a filter that deletes mail b) there's been a connection using a POP3 client and the more likely c) the user actually deletes the mail themselves. Other than that and without log files it's almost impossible to tell you exactly what happened.
    I have not checked in to A yet, but I would be surprised if that were the case as the mail that is "missing" is from a specific date to a specific date. B is plausible, but I went in to that user's account in Windows Mail and set it to retain the messages on the server indefinitely and advised that person to not touch those settings. C is probably the most likely cause and this woman is just a ************************* (replace asterisks by every derogatory comment you can think of) and due to the fact that she's not a nice person, I would like to check the logs to see if she deleted the mail manually and show that to the guy that pays the bills and see what he has to say. I've got 20 other users on the Zimbra server and aside from a glitch with IE8, NO ONE else has complained besides this person. I would really like to shut them up for good. Any indication of where the log file might be?

  4. #4
    buee is offline Loyal Member
    Join Date
    Feb 2009
    Posts
    76
    Rep Power
    6

    Default rsync

    Quote Originally Posted by phoenix View Post
    If you have a backup of the store directory then you can use zmlmtpinject to put the records back into the mailbox. There are usually a couple of reasons mail goes 'missing' a) there's a filter that deletes mail b) there's been a connection using a POP3 client and the more likely c) the user actually deletes the mail themselves. Other than that and without log files it's almost impossible to tell you exactly what happened.
    Is there a way to use Rsync so that it won't create duplicates and won't delete anything received since perhaps? Seems logical as it's in the script for the backup, why couldn't I just do it in reverse?

  5. #5
    bdial's Avatar
    bdial is offline Moderator
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    the messages in the store directory by themselves aren't enough, there is data about them in the mysql database as well. this is why you can't just rsync because if the messages are there but not the associated data in the db they will not show up in zimbra.

  6. #6
    buee is offline Loyal Member
    Join Date
    Feb 2009
    Posts
    76
    Rep Power
    6

    Default /opt/zimbra

    Quote Originally Posted by bdial View Post
    the messages in the store directory by themselves aren't enough, there is data about them in the mysql database as well. this is why you can't just rsync because if the messages are there but not the associated data in the db they will not show up in zimbra.
    I'm doing the entire /opt/zimbra folder, won't that get the DB?

  7. #7
    bdial's Avatar
    bdial is offline Moderator
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    that'd be fine if you wanted to whole sale replace the db but then you'd be wiping out all the entries since the incident.

  8. #8
    Rich Graves is offline Outstanding Member
    Join Date
    Jan 2007
    Location
    Minnesota
    Posts
    718
    Rep Power
    9

    Default

    Re your original question 2: yes, starting several versions ago, mailbox.log has clearly shown when messages were deleted, but you only get the user, ip, folder, and message #. In theory, this could be correlated with an old msqldump or the "Adding message" log entry upon receipt.

    In practice, you're probably best off finding the user's store directory (there's a good wiki article on the message store layout), grepping backed-up messages, and lmptinjecting them.

    Don't forget to search first. In about 50% of my "lost message" cases, the message is still in inbox. 30% in Trash. I teach people not to empty trash, but to let the 30-day auto-purge deal with it. Disk space is cheaper than our time, and since your backups are discoverable anyway, I don't see that saving trash adds legal risk.

  9. #9
    buee is offline Loyal Member
    Join Date
    Feb 2009
    Posts
    76
    Rep Power
    6

    Default Open Source

    Quote Originally Posted by Rich Graves View Post
    Re your original question 2: yes, starting several versions ago, mailbox.log has clearly shown when messages were deleted, but you only get the user, ip, folder, and message #. In theory, this could be correlated with an old msqldump or the "Adding message" log entry upon receipt.

    In practice, you're probably best off finding the user's store directory (there's a good wiki article on the message store layout), grepping backed-up messages, and lmptinjecting them.

    Don't forget to search first. In about 50% of my "lost message" cases, the message is still in inbox. 30% in Trash. I teach people not to empty trash, but to let the 30-day auto-purge deal with it. Disk space is cheaper than our time, and since your backups are discoverable anyway, I don't see that saving trash adds legal risk.
    Right now, I'm using the open source edition so the backups are somewhat "ghetto". Using rsync, I sync /opt/zimbra over, shut down Zimbra, rsync again, start Zimbra, tar the files. I'm told that the lmtpinject method will not work with that backup method. Can anyone confirm or deny this?

  10. #10
    Rich Graves is offline Outstanding Member
    Join Date
    Jan 2007
    Location
    Minnesota
    Posts
    718
    Rep Power
    9

    Default

    I think bdial missed or misunderstood the use of lmtpinject. It is true that finding and restoring the files in /opt/zimbra/store is not sufficient. They need to be imported via rest or lmtp. lmtpinject does literally the same thing as a new incoming email (post-antivirus and antispam checks).

    If the user cares about the "Received" date being correct, you might have to get a little fancy with an x-zimbra-received header.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 658
    Last Post: 04-04-2014, 09:01 AM
  2. Backup script didn't complete via crontab
    By snake_eyes in forum Installation
    Replies: 10
    Last Post: 02-12-2010, 12:14 PM
  3. zimbra opesource Backup Script Problem!
    By tashi in forum Administrators
    Replies: 4
    Last Post: 03-30-2009, 11:49 PM
  4. [SOLVED] Backups failing, "unable to read metadata for account"
    By smcgrath1111 in forum Administrators
    Replies: 10
    Last Post: 04-10-2008, 03:15 PM
  5. Problem when restoring from incremental backup
    By Eyfi in forum Administrators
    Replies: 4
    Last Post: 06-28-2007, 08:47 AM

Posting Permissions

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