Strategies for Backup and Restore



Disaster Recovery is now part of the Backup Advanced Techniques Chapter, because it is intended more as a last-resort technique in case something wreaked havoc on your infrastructure, than a restore strategy.

In many circumstances, restoration procedures are necessary, which may vary depending on the actors involved, the breadth and extent of the restore, and the objective. Here are some instances of these scenarios:

  • the unintentional loss of emails as a result of an end-user error, such as emptying the Trash can folder
  • a file system issue that may cause reading and writing failures, rendering some elements of an account inaccessible
  • Administrative mistakes, such as those that occur during the undelete procedure
  • An account has been hacked as a result of credentials being stolen or obtained fraudulently.
  • An account is being investigated, and the whole history of the account is required by law enforcement.

In all of these scenarios, data in a mailbox can be restored, and restoration procedures are classified into two types based on the destination of the recovered data: recovery on the same server—or same infrastructure—and recovery on a different infrastructure.

Restore the same infrastructure

These solutions are intended to be used when only a portion of an account on the same server as the origin server has to be restored. This category includes Single Item Restore, Restore on New Account, Time-range Undelete, and Account Restore.

Various infrastructure restoration

When the restoration procedure is not practicable or practical on the same infrastructure as the original, the External restoration approach can be used.

It is crucial to note that things in Carbonio Backup are marked as deleted only after they have been removed from a mailbox as part of a Backup Purge operation; they are still available until that point.

Finally, all restoration methods:

  • Except for Restore Account, only the CLI may be used.
  • retrieve objects at a certain point (or interval) in time, implying that their state at that point is likewise recovered
  • retrieve an item from a folder other than the original
  • Always send an email to the restore operation’s initiator and the administrator at the start and completion of the procedure.

How to obtain the itemID

The itemID is one of the metadata of an item and consists of an unambiguous code that uniquely identifies an object in a mailbox.

Along with all other metadata about an item, the itemID is assigned by the server and stored in a file inside the items directory of the proper account under the directory:

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

For example, when a new email message arrives, the log file may show an entry like:

2020-07-18 12:22:01,495 INFO [btpool0-4361://localhost/service/soap/MsgActionRequest]
mailop - adding Message (id=339) to Folder Inbox (id=1)`

Recognise an item’s ID

  • Backup_path: /opt/zextras/backup/ng/

  • Account ID: 4a217bb3-6861-4c9f-80f8-f345ae2897b5

  • Item ID: 2057

This item, and all its associated metadata is located in:


As a regular user, there is only one possibility to find the itemID: select a message and then from the Options menu (the rightmost icon  on top right corner of the email the click Show original. In the URL that will open, similar to the one below, the id is the trailing part, in this case 2057:

All item’s metadata are stored in a plain text file, so Linux tools like grep and find can be combined to search for items and their content. To see the metadata contained in a file in a more readable format, you can use the carbonio backup getItem command, whose syntax is carbonio backup getItem {account} {item} [attr1 value1 [attr2 value2…]]

Options in {curly braces} are mandatory:

  • account is the ID of an account

  • item is the itemID

Usage example:

zextras$ carbonio backup getitem 4a217bb3-6861-4c9f-80f8-f345ae2897b5 2057

If the message is no longer available, for example because it was removed from the trash bin, it can still be obtained by searching the mailbox.log log file for one of the message’s other metadata, such as the time it was deleted, the sender or recipient, the content, and so on. This approach, however, is only viable with administrative access, so if you do not have it, you must contact your administrator for assistance.

Example log entry

In the above example, the item with id 339 is moved to the trash folder and soon after the folder is removed:

2020-07-18 15:22:01,495 INFO [btpool0-4361://localhost/service/soap/MsgActionRequest]
mailop - moving Message (id=339) to Folder Trash (id=3)

2020-07-18 15:25:08,962 INFO  [btpool0-4364://localhost/service/soap/FolderActionRequest]
mailbox - Emptying 9 items from /Trash, removeSubfolders=true.
Restoring a Single Item

One of the Restore Modes offered in Carbonio Backup is Single thing Restore, which allows you to restore one thing at a time, regaining its state even if it was removed.

The itemID is used by Single Item Restore to restore the associated item from the backup to the owner’s account. This method may be used to repair any sort of object.

A Single Item Restore is being run.

Use the command to begin an Item Restore procedure.

zextras$ carbonio backup doItemRestore {Account name or id} {item_id} [attr1 value1 [attr2 value2...]]