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 03-24-2010, 12:22 PM
Junior Member
 
Posts: 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
Quote:
[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..
Reply With Quote
  #2 (permalink)  
Old 03-24-2010, 12:59 PM
Moderator
 
Posts: 1,554
Default

does the /opt/zimbra/backup/accounts.xml have the old or new id?
Reply With Quote
  #3 (permalink)  
Old 03-24-2010, 01:10 PM
Junior Member
 
Posts: 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.)
Reply With Quote
  #4 (permalink)  
Old 03-24-2010, 01:16 PM
Moderator
 
Posts: 1,554
Default

what if you changed it to the old id temporarily?
Reply With Quote
  #5 (permalink)  
Old 03-24-2010, 01:23 PM
Junior Member
 
Posts: 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.
Reply With Quote
  #6 (permalink)  
Old 03-24-2010, 01:27 PM
Moderator
 
Posts: 1,554
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.
Reply With Quote
  #7 (permalink)  
Old 03-24-2010, 01:29 PM
Junior Member
 
Posts: 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!)
Reply With Quote
  #8 (permalink)  
Old 03-26-2010, 12:39 PM
Junior Member
 
Posts: 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:
Quote:
zmbackupquery -a name1@example.org --from 20100315000000 --to 20100319235959
This will yield a list of full and incr(emental) labels:
Quote:
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
Quote:
$ cat accounts.xml | grep name1@example.org
Result (example):
Quote:
<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:
Quote:
$ 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:
Quote:
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
Quote:
$ cp accounts.xml.VB20100326_oldID accounts.xml
Reply With Quote
  #9 (permalink)  
Old 03-26-2010, 03:34 PM
Moderator
 
Posts: 1,554
Default

cool, thanks for posting the detailed fix these kind of things really come in handy!
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.