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

Thread: Recover data from store folders

  1. #1
    mkswanson is offline Junior Member
    Join Date
    Oct 2007
    Posts
    9
    Rep Power
    7

    Exclamation Recover data from store folders

    This is a desparate cry for help...please chime in if you can!

    I have had MAJOR problems with my Zimbra intalation which was working fine for the past week and then completely stopped. I traced through one error after another, and was less than successful in getting it back up.

    I have rebuilt my box, and recreated the users, so it is working again, but I NEED to recover the data from some of the users' folders (there's not that many). Is it possible to restore from the data in the /opt/zimbra/db/data/mbox... directories?? I tried copying them in, and then everything starts to go to h*** again.

    Does anyone have any suggestions?

  2. #2
    jholder's Avatar
    jholder is offline Former Zimbran
    Join Date
    Oct 2005
    Location
    Thatcher, AZ
    Posts
    5,606
    Rep Power
    20

    Default

    It would be very difficult to recover directly from the DB metadata. As a matter of fact, I've never actually done it.

    Do you have a copy of your bad instance? It might be better to get that working, then either use that instance, or get it working enough to where you can export the data.

  3. #3
    mkswanson is offline Junior Member
    Join Date
    Oct 2007
    Posts
    9
    Rep Power
    7

    Default

    I have bits and pieces of it. It won't start up, and I have honestly made so many changes and ran so many fixes and reinstalled the application (the list goes on...) that I don't really have the slightest idea where to begin to try to recover it, or if it is even possible. I was scrambling to try to get email access restored and was trying everything I could think of/find.

    Any suggestion you have would be greatly appreciated.

  4. #4
    mmorse's Avatar
    mmorse is offline Moderator
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    20

    Default

    How 'few users'?
    In the mean time while you're trying to get the box working - as I dont' know what your time frame/criticalness of getting certain messages is yet.

    Now this will loose all folder structure, tags, read status - but you will at least get the messages.

    Move the failedbox:/opt/zimbra/store to your livebox:/workspace/oldstore
    (grab from the backups whatever just don't overwrite the live store!)

    Steps:

    Browse to the oldstore folder
    make sure everything's owned by zimbra:zimbra

    It has a subfolder called incoming that you can ignore
    And at least one numbered folder starting with 0.
    Look at the subfolders of these numbered folders, which are also numbered
    In other words, oldstore/0/1, oldstore/0/2, etc.
    Each of these sub-subfolders contains all the mail for a single user.
    These leaf directories will be named something like store/0/1/msg/0
    You'll have to figure out whose folder is whose by 'brainpower and observation' (more #-#.msg)
    (oh you're gonna have some fun with remembering numbers & where your at!)

    & you can add the messages in the leaf folders in that directory to the appropriate account on your live mailbox server as you wish or choose to leave the whole thing at /oldstore for a while

    So, when you've figured out who a given folder belongs to:

    Method 1:
    attach to the new server via
    zmmailbox -zadmin
    or
    zmmailbox adminAuthenticate -u https://server.domain.com:7071 admin@domain.com password
    mbox> selectMailbox user@domain.com
    mbox> createfolder /Recovery
    mbox> zmmailbox addMessage /Recovery store/0/1/msg/1 (or whatever the path to the leaf folder is) -- all the mail in the subfolder will be added. Repeat for the remainder of the leaf folders in that mailbox's folder.
    think it's -d if your having date trouble with the dates and the header
    you can go zmmailbox help commands

    Repeat for next user etc etc

    Note: To get the dates correct you need to rewrite X-Zimbra-Received header see: http://www.zimbra.com/forums/adminis....html#post4017

    Method 2:
    zmlmtpinject -r user@domain.com -s sender@domain.com /opt/zimbra/location/#/#/msg/123-4.msg

    Injecting a whole folder of files would be:
    zmlmtpinject -r user@example.com -s sender@domain.com -d /opt/zimbra/location/#/#/

    Rinse and repeat

    If you do this a bunch over and over in a short time you might have you'll run into the single instance storage/drop duplicate fun. Though you can turn that off across the entire board by globally setting zimbraMessageIdDedupeCacheSize to 0 for a bit.

    zmlmtpinject [options] [files]
    [options]:
    -a,--address lmtp server (default localhost)
    -d,--directory message file directory
    -D,--domain default per-connection recipient domain (default example.zimbra.com)
    -N,--every report progress after every N messages (default 100)
    -p,--port lmtp server port (default 7025)
    -q,--quiet don't print per-message status
    -r,--recipient envelope recipients (rcpt to). This option accepts multiple arguments, so it can't be last if a list of input files is used.
    -S,--stopAfter stop after sending this many messages after warm-up
    -s,--sender envelope sender (mail from)
    -t,--threads number of worker threads (default 1)
    -T,--trace trace server/client traffic
    -u,--username username prefix (default "user")
    -w,--warmUpThreshold warm-up server with first N messages, then start measuring (default no warm-up)
    -z,--repeat repeatedly inject these messages NUM times
    (won't actually make additional physical copies unless you turn off the zimbraMessageIdDedupeCacheSize)
    [files]:
    Direct link to file in rfc822 format, or specify a directory.

    Note: To get the dates correct you need to rewrite X-Zimbra-Received header see: http://www.zimbra.com/forums/adminis....html#post4017

    Method 3:

    You can POST an RFC822 formatted message to your inbox REST url to append messages to the inbox folder. Using the popular curl program, this would look like the following:

    curl -u username:yourpassword --data-binary @/tmp/rfc822.txt https://server/service/home/username/inbox

    Method 4:

    Thick clients that can take .msg
    Import EML and MSG email message files into Outlook

    --

    Remember there's no metadata (like tags/flags/read status) attached to these methods.
    Wherever possible I would provide a 'recovered' directory in the user's accounts.
    The folder structure can get confusing fast, and you'll hate yourself if you end up putting stuff in the wrong folders...
    One alternative is instead of working in the live you could setup an isolated temp box, import everything make it look 'pretty' then imapsync the temp box user's recoveryfolder > live.

    Best of luck, and I hope you don't have to go those tedious routes.
    Last edited by mmorse; 07-06-2008 at 11:20 AM.

  5. #5
    jholder's Avatar
    jholder is offline Former Zimbran
    Join Date
    Oct 2005
    Location
    Thatcher, AZ
    Posts
    5,606
    Rep Power
    20

    Default

    What bits and peices?

    The ones that you need to care about are:
    /opt/zimbra/db
    /opt/zimbra/store
    /opt/zimbra/openldap-data OR /opt/zimbra/openldap.bak

    With those, we can rebuild.

  6. #6
    jholder's Avatar
    jholder is offline Former Zimbran
    Join Date
    Oct 2005
    Location
    Thatcher, AZ
    Posts
    5,606
    Rep Power
    20

    Default

    With regard to mike's post, that'll work too. Keep in mind that you'll loose all metadata.

    I would only use that if you've lost the mysqldb. It's defenetly an option for disaster recovery.

  7. #7
    mmorse's Avatar
    mmorse is offline Moderator
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    20

    Default

    Quote Originally Posted by mmorse View Post
    How 'few users'?
    In the mean time while you're trying to get the box working - as I dont' know what your time frame/criticalness of getting certain messages is yet.

    Now this will loose all folder structure, tags, read status - but you will at least get the messages.
    yup, my methods will be a very tedious process & only help you with your messages

    I had another thought if you do choose to do those:
    The folder structure can get confusing fast, and you'll hate yourself if you end up putting stuff in the wrong folders...
    So instead of working in the live you could setup a test box, import everything make it look 'pretty' then imapsync test > live.

  8. #8
    mkswanson is offline Junior Member
    Join Date
    Oct 2007
    Posts
    9
    Rep Power
    7

    Default

    I think I have those files, but I ran an install.sh -u, so I am not sure if the files (other than the /opt/zimbra/db/data directory, which I took a manual backup of) are the originals.

    The data I am extremely concerned about is the calendars and contacts. If I have to deal without the mesages, it won't be the end of the world, although it is not the preferred method.

    When I looked in the store directory, one copy listed total 0, and the other listed incoming 0.

    Thanks again for the help!

  9. #9
    jholder's Avatar
    jholder is offline Former Zimbran
    Join Date
    Oct 2005
    Location
    Thatcher, AZ
    Posts
    5,606
    Rep Power
    20

    Default

    Dude-
    I'm sorry to tell you this, but you're pretty much toast. install.sh -u does in fact remove everything. Even Mike's method won't work, as you don't have the message store.

    The best hope you have is to take a look at the account db structure and try to export it, then import it. You'll need to try and dump the dbs to sql files, then reinject them. . .but that is further than a long shot.

    I've never done it so I don't have any advice for ya. This wiki article might be able to provide more information:
    Account mailbox database structure - Zimbra :: Wiki
    the zmprov commands won't work, but it gives you an idea with how we store the data.

    That's about the best I can do.

    Good luck,
    jh

  10. #10
    mkswanson is offline Junior Member
    Join Date
    Oct 2007
    Posts
    9
    Rep Power
    7

    Default

    Thanks.

    When I try to startup the services on the old box, it doesn't startup mysql.server.

    When I run mysql start, I get error 1045 (2000): Access denied for user 'zimbra'@'localhost' (using password: YES). Any thoughts on how to get this resolved?

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. mysql data store rebuild
    By ashelley in forum Administrators
    Replies: 3
    Last Post: 03-23-2010, 03:39 PM
  2. .pst migration issues
    By jimklein in forum Migration
    Replies: 13
    Last Post: 02-16-2009, 01:55 AM
  3. Error when Using Outlook PST Importer
    By chh in forum Zimbra Connector for Outlook
    Replies: 1
    Last Post: 01-19-2009, 05:20 AM
  4. IMAP error: unable to store IMAP message data
    By ebatte in forum Administrators
    Replies: 8
    Last Post: 04-27-2008, 09:50 PM
  5. Replies: 2
    Last Post: 02-12-2008, 11:55 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
  •