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 12-23-2010, 03:14 PM
Starter Member
 
Posts: 1
Default It is possible to backup emails from mailboxes and restore independently equally

Hi support.

It is possible to backup emails from mailboxes and restore independently equally

I need backup mailboxes independently by users, in case of loss or failure of these in a notebook recovered historically.

Mauro!
Reply With Quote
  #2 (permalink)  
Old 12-23-2010, 11:09 PM
Zimbra Consultant & Moderator
 
Posts: 20,313
Default

Quote:
Originally Posted by mpereira View Post
Hi support.
This isn't 'support', it's a Community forum.

Quote:
Originally Posted by mpereira View Post
It is possible to backup emails from mailboxes and restore independently equally
There is no backup/restore facility provided with the Open Source version of Zimbra, there is in the Network Edition.

Quote:
Originally Posted by mpereira View Post
I need backup mailboxes independently by users, in case of loss or failure of these in a notebook recovered historically.
Search the forums for details of backup/restore scripts, look on the front page of the wiki (link at the top of this page) for backup scripts and also search the wiki for the word 'REST' for details on how to export/import data into Zimbra.
__________________
Regards


Bill

Last edited by phoenix; 12-24-2010 at 12:25 PM..
Reply With Quote
  #3 (permalink)  
Old 12-24-2010, 04:41 AM
Elite Member
 
Posts: 334
Default

Quote:
Originally Posted by mpereira View Post
Hi support.

It is possible to backup emails from mailboxes and restore independently equally

I need backup mailboxes independently by users, in case of loss or failure of these in a notebook recovered historically.

Mauro!
I have a script to backup all Zimbra mailbox into separated .tgz file for each account, just modify script to meet with your requirement.

Code:
#!/bin/bash
### START CONFIGURATION ###
DIR="/tmp/zimbra";
OUTPUT="/tmp/zimbra";
### END OF CONFIGURATION ###

USERS=`su - zimbra -c 'zmprov -l gaa'`;
DATE=`date +%Y%m%d`;

if [ ! -d $DIR ]; then mkdir $DIR; chown zimbra:zimbra $DIR; fi

for ACCOUNT in $USERS; do
        NAME=`echo $ACCOUNT | awk -F@ '{print $1}'`;
        su - zimbra -c "zmmailbox -z -m $ACCOUNT getRestURL '//?fmt=tgz' > $DIR/$NAME.tgz";
done
cd $DIR; mkdir $DATE; mv *.tgz $DATE
tar cjpf $OUTPUT/$DATE.tar.bz2 $DATE;
cd $DIR; rm -rf $DATE
The above script will looping fo each account, making backup to the specified folder and then making a compressed file for the folder and it's content. Modify the above script if you want to backup specified account only.

Hope it helps, please let me know if you encounter any problem regarding the script.
__________________
Best Regards
---
Masim "Vavai" Sugianto
Vavai Personal Blog
Personal Blog [ID]

Release 7.1.3_GA_3346.SLES11_64_20110930001521 SLES11_64 FOSS edition.
Reply With Quote
  #4 (permalink)  
Old 12-24-2010, 06:11 AM
Elite Member
 
Posts: 303
Default

Quote:
Originally Posted by vavai View Post

Hope it helps, please let me know if you encounter any problem regarding the script.
And, just to fill in the blank on how to do a restore.

You can take the .tgz file that is created and log into the newly created account and under preferences, do an import of it.

Doug
__________________
Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
Reply With Quote
  #5 (permalink)  
Old 12-24-2010, 06:57 AM
Elite Member
 
Posts: 334
Default

Quote:
Originally Posted by lytledd View Post
And, just to fill in the blank on how to do a restore.

You can take the .tgz file that is created and log into the newly created account and under preferences, do an import of it.

Doug
Thanks for completing the above procedure, Doug .

For anyone who would like to restore a bunch of mailbox backup, below are a simple script to bulk restore, please modify accordingly.

Code:
#!/bin/bash
### START CONFIGURATION ###
DIR="/srv/20100315";
### END OF CONFIGURATION ###

clear

echo "Retrieve zimbra user name..."

USERS=`su - zimbra -c 'zmprov -l gaa'`;

for ACCOUNT in $USERS; do
        NAME=`echo $ACCOUNT`;
        echo "Restoring $NAME mailbox..."
	su - zimbra -c "zmmailbox -z -m $NAME postRestURL '//?fmt=tgz&resolve=reset' $DIR/$NAME.tgz";
done
echo "All mailbox has been restored sucessfully"
Change DIR parameter with the folder of backup mailbox and change USERS parameter with list of account.
__________________
Best Regards
---
Masim "Vavai" Sugianto
Vavai Personal Blog
Personal Blog [ID]

Release 7.1.3_GA_3346.SLES11_64_20110930001521 SLES11_64 FOSS edition.
Reply With Quote
  #6 (permalink)  
Old 12-24-2010, 11:54 AM
Advanced Member
 
Posts: 213
Default

The above method restores entire mailboxes.

An alternate method would be to back up the entire zimbra directory...
[SOLVED] Yet Another Backup Script for Community Version

...then create per-user backups...
[SOLVED] Yet Another Backup Script for Community Version

...and restore individual folders if that's all you need.
[SOLVED] Yet Another Backup Script for Community Version

This might come in handy for users, like me, who have multiple gigabytes of mail.

Or, perhaps you could use the REST method above, then
  1. Restore an entire user to a temporary user
  2. Share the mail folder you want to restore
  3. Connect to the share as the original user and copy items over.
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.