Restoring one mailbox
Somebody has accidentally deleted one mailbox from the server v4 opensource. I have a back up of the complete system (everything under /opt/zimbra) which is 2 months old. How can restore that specific account back from this backup?
Thanking you in advance
I went through the same thing recently...
I pulled over all their files from /opt/zimbra/store (storing them in say /tmp/backup/). Then I did (as user zimbra):
% zmmailbox -z
adminAuthenticate firstname.lastname@example.org my_password
addMessage /Recover /tmp/backup/msg/0 /tmp/backup/msg/1 <etc>
I still need to figure out how to copy over the calendar though. If anyone knows how to pull over the calendar please let me know!!
Thank you Madcat
This certainly helps. But how can I recover all messages. How can I put this in an script? This way for each message I need to issue one recover command.
Point it at a folder...
I believe that you can point zmmailbox addMessage at a folder full of messages and have it add all of them.
Thank you very much. Now another question. How can I find out the folder number of the deleted user?
Great! Thanks for those who helped, I recovered the data. For finding the mailbox, I did a grep. It took a long time but at last I found it! In fact it adds the whole e-mails in the folder. So for each folder in the user inbox, the command should be run separately. Now, as Madcat mentioned, the only problem is the rest of the information. Critically contacts and then calender. Any ideas?
I wrote a Perl script that extracted the email/userid from the database and then piped the input into zmmailbox. It took a few hours to roll through 600+ email accounts. 5 power outages in one day scrambled my clients email server...
Sounds like we are in the same boat regarding the calendar. If someone knows how to get the data I'll be happy to provide a sh/perl script!
Looks like zmprov has the calendar functionality. If I have any luck I'll post my findings...
I looked into it more. It seems that to extract the contacts, the only way is to at least run OpenLDAP with its database on some another machine and then extract data out of it.
I have to say you guys rock, this was the last step keeping me from fully implementing zimbra. I've been using it interchangeably with Exchange for the last 6 months and it easily trumps Exchange.
Madcat if you wouldn't mind could you send me the perl script that you wrote, I would like to test it on a spare mailbox server I just installed.