Results 1 to 9 of 9

Thread: [SOLVED] restore between zimbraids when mailbox name is the same for both

  1. #1
    Join Date
    Mar 2009
    Location
    Detroit, MI
    Posts
    6
    Rep Power
    6

    Default [SOLVED] restore between zimbraids when mailbox name is the same for both

    ENVIRONMENT
    • University implementation using our AccessID as the mailbox (email) name, therefore rendering the fully qualified name as AccessID@wayne.edu (using "xy1234@wayne.edu" as an example here)
    • There are six mailstores in the system. (using "mailstore5" as an example here)


    DESCRIPTION
    • I have a user's account that was de-provisioned by accident. (It was completely removed from the mailstore, using zmprov with the da argument.)
    • Subsequently, it was re-provisioned under the same mailbox name (xy1234@wayne.edu)... ironically, on the same mailstore (mailstore5) it was removed from!
    • Now I have the task of restoring the mailbox contents from before it's de-provisioning (without affect to the current mailbox) and am not sure how to get to the backup data. (I have done many restores just fine, but not yet when the mailbox is associated with two different zimbraid labels!)

    DETAILS
    • xy1234@wayne.edu has been associated with two different zimbraid labels
    • A look at zmbackupquery does indeed find the mailbox xy1234@wayne.edu in the expected full- and incr- backup account lists, under the old "Acct ID" (as labelled in the zmbackupquery results)/zimbraid (as labelled in the respective backup logs), as would be expected.
    • An attempt to restore to point in time results in the report of an error, stating "no such backup for account", though, attempting to find the data via the new zimbraid!

    example
    [zimbra@mailstore5 ~]$ zmrestore -ca -a xy1234@wayne.edu -pre restore_ -restoreToTime 20100318235959
    using restore to time of 2010/03/18 23:59:59
    Error occurred: no such backup for account: Missing full backup earlier than restore-to time for account f3e14620-7bfc-4e31-9a2d-a6345d3fc553
    (Note: This is not the actual data, but the content is in this form.)

    This is correct in a sense, because this is the new zimbraid and it truly was not yet in commission in this timeframe! I need it to restore contents from the old zimbraid somehow... (Notice I am using the "prefix" argument so that it would be going to a different "account".)

    NEED
    Mailbox contents of "zimbraid_old" restored so I can imapsync the contents into the "zimbraid_new" mailbox (restore/imapsync is my usual/preferred procedure that I use under "normal" circumstances).

    THOUGHTS
    • Am I able to use the zimbraid as my argument for -a in the zmrestore command?
    • I am also wondering if I can restore the last full- with the old zimbraid specifically to my prefixed "new"/manually created account and then somehow apply the two incrementals that the old zimbraid is in - might that be possible?
    • Or might you have another solution?
    Last edited by vbamcan; 03-24-2010 at 01:03 PM.

  2. #2
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    does the /opt/zimbra/backup/accounts.xml have the old or new id?

  3. #3
    Join Date
    Mar 2009
    Location
    Detroit, MI
    Posts
    6
    Rep Power
    6

    Default

    accounts.xml has the new id - because, of course, it lists the most recent full backup. (Taken 23 March, whilst I need the content from 18 March - when it was still the old id.) The old id is not listed in there at all... (It is in the full and incr backups session.xml files of its day - 18 March and before.)

  4. #4
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    what if you changed it to the old id temporarily?

  5. #5
    Join Date
    Mar 2009
    Location
    Detroit, MI
    Posts
    6
    Rep Power
    6

    Default

    In that .xml file I would assume... That would be OK/kosher do you think? I am the careful type and don't want to "blow anything up".

    This is a production system, so care has to be taken. The user would cooperate if I told her to leave the account alone for awhile, I'm sure.

  6. #6
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    yeah in hte xml file. back it up first of course. i dont think it would be any problem as long as you restore the old one by the time the backup runs again, so find out when that is going to happen.

  7. #7
    Join Date
    Mar 2009
    Location
    Detroit, MI
    Posts
    6
    Rep Power
    6

    Default

    OK - I'm game. I do understand about the file backup - you betcha! And our backups run after midnight some time, so I'm in touch with that, too. I'll report back on how it goes... keep your fingers crossed! (I can't, I have important stuff to type!)

  8. #8
    Join Date
    Mar 2009
    Location
    Detroit, MI
    Posts
    6
    Rep Power
    6

    Default

    Thank you for confirmation, bdial!

    ----------
    SOLUTION
    ----------
    This is only an issue if two different zimbraIds (Account IDs/UUIDs) have been associated with the same e-mail name on a mailstore. In our case, this was caused by an e-mail name being deprovisioned then, in the luck of the draw, ended up being reprovisioned on the same mailstore.

    1. Identify the new zimbraId, the old zimbraId and the last full backup label for the old zimbraId.
    If you run a zmbackupquery in the timeframe before the e-mail name was deprovisioned, you will get this information in the results. You man have to try a couple times to make sure your "from" argument is early enough to get a full label.
    example - account removed 19 March 2010:
    zmbackupquery -a name1@example.org --from 20100315000000 --to 20100319235959
    This will yield a list of full and incr(emental) labels:
    Account: name1@example.org

    Label: incr-20100318.050602.864
    Type: incremental
    Started: Thu, 2010/03/18 01:06:02.864 EDT
    Ended: Thu, 2010/03/18 01:59:06.209 EDT
    Acct ID: e3204d2f-7451-...snip...

    Label: incr-20100317.050630.370
    Type: incremental
    Started: Wed, 2010/03/17 01:06:30.370 EDT
    Ended: Wed, 2010/03/17 01:58:09.250 EDT
    Acct ID: e3204d2f-7451-...snip...

    Label: full-20100315.050026.256
    Type: full
    Started: Mon, 2010/03/15 01:00:26.256 EDT
    Ended: Tue, 2010/03/16 05:11:01.748 EDT
    Acct ID: e3204d2f-7451-...snip...
    2. Note current accounts.xml contents
    PATH: $HOME/backup/accounts.xml
    $ cat accounts.xml | grep name1@example.org
    Result (example):
    <account zimbraId="e36217fd-732c-...snip..." email="name1@example.org" latestFullBackupLabel="full-20100323.123530.007">
    This reveals the new zimbraId and current full backup label.
    Copy accounts.xml with a fitting label. (Best Practice move!)
    example:
    $ cp accounts.xml accounts.xml.VB20100326_oldID
    3. Modify accounts.xml
    Using your preferred text editor, change the "zimbraId" to the old ID and the "latestFullBackupLabel" to the older full label you collected earlier.
    (You might even want to copy this version of accounts.xml to an approriately labelled copy just in case.)

    4. Run your restoration
    You have to use specific full and incr(emental) arguments for zmrestore to work well with this scenario. You must use the labels that you have collected above. (You cannot do, for instance, a "-restoreToTime" argument.)
    example:
    zmrestore -ca -a name1@example.com -pre restore_ -lb full-20100315.050026.256 -restoreToIncrLabel incr-20100318.050602.864
    (Notice the "-pre" argument with a label that will be added to the begining of the e-mail name, resulting in an account named "restore_name1@example.com" You can make "restore_" any text you'd like - this is a standard I have produced for myself.)
    I use this procedure and then imapsync the retrieved content into a Restore folder in the user's current account. This is sort of a fail-safe I've built for myself.

    5. Make sure to return the accounts.xml file back to normal/current settings
    $ cp accounts.xml.VB20100326_oldID accounts.xml

  9. #9
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    cool, thanks for posting the detailed fix these kind of things really come in handy!

Similar Threads

  1. Replies: 9
    Last Post: 05-06-2009, 01:49 AM
  2. [SOLVED] Mailbox restore restores to the wrong date
    By silbro in forum Administrators
    Replies: 2
    Last Post: 12-05-2008, 01:59 PM
  3. I can't restore a mailbox to a previous state
    By DougWare in forum Administrators
    Replies: 5
    Last Post: 03-24-2008, 09:36 AM
  4. Restore mail to another user's mailbox
    By zaf in forum Administrators
    Replies: 4
    Last Post: 02-08-2008, 07:26 AM
  5. can't you help me
    By iwan siahaan in forum Administrators
    Replies: 6
    Last Post: 12-17-2007, 05:53 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
  •