Difference between revisions of "Zimbra Next Generation Modules/Zimbra NG Backup/Item Restore"

m (1 revision imported: Zimbra NG)
 
Line 1: Line 1:
<div class="col-md-12"><br></div>
+
#REDIRECT [[Zimbra_NG_Modules/Zimbra_NG_Backup/Item_Restore]]
<div class="col-md-12"><br></div>
 
<ol class="breadcrumb">
 
  <li>[[Main Page|Zimbra Wiki]]</li>
 
  <li>[[Zimbra_Next_Generation_Modules]]</li>
 
  <li>[[Zimbra_NG_Backup]]</li>
 
  <li class="active"> Item Restore</li>
 
</ol>
 
__NOTOC__
 
<div class="col-md-12"><br /></div>
 
<div class="col-md-9">
 
    <h2 class="title-header" style="padding-bottom: 9px; border-bottom: 4px solid #0087c3;">Zimbra NG Backup - Item Restore</h2>
 
    <div class="col-md-12">
 
        <div class="ibox-content">
 
            <div class="post animated fadeInLeft animation-delay-8" style="padding-top:5px">
 
                <div class="panel panel-default">
 
                    <div class="panel-body">
 
                        <h5 class="post-title">Zimbra NG Backup - Item Restore</h5>
 
                        <div class="row">
 
 
 
== 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 [[Zimbra_Next_Generation_Modules/Zimbra_NG_Backup/Store|backup store]] to the owner's account. Any type of item can be restored this way.
 
 
 
== Running an Item Restore ==
 
===Via the Zimbra Next Generation Modules Administration Zimlet===
 
The Item Restore is only available through the Zimbra Next Generation Modules CLI
 
 
 
===Via the Zimbra Next Generation Modules CLI===
 
To start an Item Restore operation, the "doItemRestore" command is available:
 
<pre><nowiki>
 
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
 
</nowiki></pre>
 
 
 
==== 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_Next_Generation_Modules/Zimbra_NG_Backup/Store|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:
 
 
 
<pre><nowiki>
 
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
 
</nowiki></pre>
 
 
 
== "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.
 
                        </div>
 
                    </div>
 
                    <div class="col-md-9">
 
                        <div class="panel-footer">
 
                            <p><i class="fa fa-clock-o"></i> Aug 25, 2016 - [https://www.zimbra.com/email-server-software/ Know more »]</p>
 
                        </div>
 
                    </div>
 
                </div>
 
            </div>
 
        </div>
 
    </div>
 
</div>
 
<div class="col-md-3"><br /></div>
 
<div class="col-md-3">
 
    <div class="panel panel-zimbrared-light-border">
 
        <div class="panel-heading">
 
            <h3 class="panel-title"><i class="fa fa-gear pull-left"></i> Zimbra Next Generation Modules</h3>
 
        </div>
 
        <div class="panel-body">
 
            {{ZNG}}
 
        </div>
 
    </div>
 
</div>
 
<div class="col-md-3">
 
    <div class="panel panel-primary-light-border">
 
        <div class="panel-heading">
 
            <h3 class="panel-title"><i class="fa fa-info-circle pull-left"></i> Zimbra Next Generation Modules Resources</h3>
 
        </div>
 
        <div class="panel-body">
 
            {{ZNGL}}
 
        </div>
 
    </div>
 
</div>
 
<div class="clearfix"></div>
 
<div class="col-md-12"><br></div>
 
{{FH}}
 

Latest revision as of 12:50, 29 November 2017

Jump to: navigation, search