Zimbra NG Modules/Zimbra NG Backup/Item Restore




Zimbra NG Backup - Item Restore

Zimbra NG Backup - Item Restore

What is the Item Restore?

The Item Restore is one of the Restore Modes of Zimbra NG Backup.

How does it work?

A single item is restored from the backup store to the owner's account. Any type of item can be restored this way.

Running an Item Restore

Via the Zimbra NG Modules Administration Zimlet

The Item Restore is only available through the Zimbra NG Modules CLI

Via the Zimbra NG Modules CLI

To start an Item Restore operation, the "doItemRestore" command is available:

Syntax:
   zxsuite backup doItemRestore {account_name} {item_id} [attr1 value1 [attr2 value2...]]

PARAMETER LIST

NAME                 TYPE            
account_name(M)      Account Name    
item_id(M)           Integer         
restore_folder(O)    String          

(M) == mandatory parameter, (O) == optional parameter

Usage example:

zxsuite backup doitemrestore john@example.com 4784
Restores item 4784 in the "john@example.com" mailbox

How to obtain the itemID

The "itemID" is one of the so-called "metadata" of an item consisting in an univoque code that identifies an item in a mailbox.

Along with all other metadata, it is stored in a file inside the "items" directory of the proper account in Zimbra NG Backup datastore. The exact location of such directory is

  [backup path]/accounts/[accountID]/items/[last 2 digits of itemID]/[itemID]

e.g.:

 Item 2057 of account 4a217bb3-6861-4c9f-80f8-f345ae2897b5, default backup path
 /opt/zimbra/backup/zextras/accounts/4a217bb3-6861-4c9f-80f8-f345ae2897b5/items/57/2057


Metadata are stored in a plaintext file, so tools like `grep` and `find` can be used to search for contents. In order to see the metadata contained in a file in a more readable format you can use the `zxsuite backup getItem` command:

Syntax:
   zxsuite backup getItem {account} {item} [attr1 value1 [attr2 value2...]]

PARAMETER LIST

NAME              TYPE               EXPECTED VALUES            DEFAULT
account(M)        Account Name/ID                               
item(M)           Integer                                       
backup_path(O)    Path                                          /opt/zimbra/backup/zextras/
dump_blob(O)      Boolean            true|false                 false
date(O)           Date               dd/mm/yyyy hh:mm:ss|all    last

(M) == mandatory parameter, (O) == optional parameter

Usage example:

zxsuite backup getitem a7300a00-56ec-46c3-9773-c6ef7c4f3636 1
Shows item with id = 1 belonging to account a7300a00-56ec-46c3-9773-c6ef7c4f3636
zimbra@simone:~$ zxsuite backup getitem      

command getItem requires more parameters

Syntax:
   zxsuite backup getItem {account} {item} [attr1 value1 [attr2 value2...]]

PARAMETER LIST

NAME              TYPE               EXPECTED VALUES            DEFAULT
account(M)        Account Name/ID                               
item(M)           Integer                                       
backup_path(O)    Path                                          /opt/zimbra/backup/zextras/
dump_blob(O)      Boolean            true|false                 false
date(O)           Date               dd/mm/yyyy hh:mm:ss|all    last

(M) == mandatory parameter, (O) == optional parameter

Usage example:

zxsuite backup getitem a7300a00-56ec-46c3-9773-c6ef7c4f3636 1
Shows item with id = 1 belonging to account a7300a00-56ec-46c3-9773-c6ef7c4f3636

"Real Life" example

Let's say a user moves one item to the Trash...

 2013-07-18 15:22:01,495 INFO  [btpool0-4361://localhost/service/soap/MsgActionRequest 
 [name=user@domain.com;mid=2538;oip=258.236.789.647;ua=zclient/7.2.4_GA_2900;] mailop - moving Message (id=339) to Folder Trash (id=3)

... and empties the trash.

 2013-07-18 15:25:08,962 INFO  [btpool0-4364://localhost/service/soap/FolderActionRequest] 
 [name=user@domain.com;mid=2538;oip=258.236.789.647;ua=zclient/7.2.4_GA_2900;] mailbox - Emptying 9 items from /Trash, removeSubfolders=true. 


She then calls the Administrator in order to restore the deleted item. Knowing the itemID and the email address, the mighty Administrator only needs to run

 zxsuite backup doItemRestore user@domain.com 339

as the `zimbra` user to restore the missing item.


Zimbra NG Modules

zimbra-logo-color.png

Latest Version: 8.8

Zimbra NG Modules Resources

Here you can find useful resources for your Zimbra NG Modules



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search