View Single Post
  #28 (permalink)  
Old 03-24-2010, 02:56 AM
ict4schools ict4schools is offline
Junior Member
 
Posts: 9
Default

Thanks for the script. However, I do detect some sort of problem. When restoring the mailbox, you'll get the storage, which is a flat directory, with no folder structure at all and the MySQL datastore (See: Zimbra Server - Zimbra :: Wiki).

Now when restoring the mailbox, restoring the storage is no problem. But when restoring the folder structure, using the MySQL datastore. You should only restore the items with the correct mailbox_id. This script however dumps the complete mboxgroup database. Which is, in my opinion a bit to much of a hassle. And will restore other accounts as well, which will leave them with indexes to deleted files as well.

I prefer to add the following lines to zimbra_backup_user.sh

line 105
Code:
zimbra_dump_sql "${mailbox} mail_item --no-create-info --where \"mailbox_id='${mailbox_id}'\" > ${current_backup}/mail_item.sql"
zimbra_dump_sql "${mailbox} appointment --no-create-info --where \"mailbox_id='${mailbox_id}'\" > ${current_backup}/appointment.sql"
zimbra_dump_sql "${mailbox} data_source_item --no-create-info --where \"mailbox_id='${mailbox_id}'\" > ${current_backup}/data_source_item.sql"
zimbra_dump_sql "${mailbox} imap_folder --no-create-info --where \"mailbox_id='${mailbox_id}'\" > ${current_backup}/imap_folder.sql"
zimbra_dump_sql "${mailbox} imap_message --no-create-info --where \"mailbox_id='${mailbox_id}'\" > ${current_backup}/imap_message.sql"
zimbra_dump_sql "${mailbox} open_conversation --no-create-info --where \"mailbox_id='${mailbox_id}'\" > ${current_backup}/open_conversation.sql"
zimbra_dump_sql "${mailbox} pop3_message --no-create-info --where \"mailbox_id='${mailbox_id}'\" > ${current_backup}/pop3_message.sql"
zimbra_dump_sql "${mailbox} revision --no-create-info --where \"mailbox_id='${mailbox_id}'\" > ${current_backup}/revision.sql"
zimbra_dump_sql "${mailbox} tombstone --no-create-info --where \"mailbox_id='${mailbox_id}'\" > ${current_backup}/tombstone.sql"
This will enable you to restore the datastore per user, instead of per mailbox group.

Thanks for the script though, which is a great help.
Reply With Quote