A retention policy defines how long and under which retention type your data should be stored in a repository..
Veeam Backup for Microsoft Office 365 provides the following types of retention:
Select this type if you want to keep an item until its creation time or last modification time is within the retention coverage.
Select this type if you want to keep an item until its latest restore point is within the retention coverage.
Data removal from backup repositories with the Item-Level Retention type occurs every time the creation time or last modification time of an item in a backup file goes beyond the retention coverage.
The following is an example that demonstrates three backup files; each file contains Microsoft Office 365 items per year where each item has its own last modification time.
For example, your retention policy is said to be applied at 10:20 AM on September 1, 2018. In such a scenario, Veeam Backup for Microsoft Office 365 will remove the Item 1 from the Backup 1 repository because the Item 1 exceeds the retention period (2 years in our example) by 20 minutes.
The next item to be removed is the Item 2 because its last modifications were made at 10:20 AM on November 11, 2016. That said, when a retention policy is being applied, for example, at 10:30 AM on November 11, 2018, Veeam Backup for Microsoft Office 365 removes the Item 2 because its age equals 2 years and 10 minutes which exceeds the specified threshold.
The same is repeated until no items left in a repository. After that, Veeam Backup for Microsoft Office 365 completely removes such a repository from the hard drive.
Data removal from backup repositories with the Snapshot-Based Retention type occurs every time the latest restore point of an item in a backup file goes beyond the retention coverage.
Mind that each item in a backup file might have its own different version, which is also considered by the retention policy.
A different version means that the user could have changed any attribute in the production environment; for instance, he could have assigned a new category to an email in the mailbox. Such an action leads to a new version of an item to be created during the subsequent backup job session.
The following example represents two backup files consisting of three items each, where each item has its own backup date. Consider the Item 1 of Backup 1 storage to be an email message, the attributes of which have been modified three times in the production environment; each modification was made on different days (Mon, Tue, and Wed) and each modification was successfully backed up.
That said, there are three different versions of the same item in a backup repository.
According to the example, if the retention policy is 1 year and said to be applied at 10:00 AM on September 12, 2018, then all the item versions that exceed the specified retention threshold will be removed from the backup repository. As per example, these versions would be the Version 1 and Version 2. The next version to be removed is the Version 3, the removal of which is about to occur right after 11:03:01 AM September 12, 2018.
Such an approach repeats itself until no other items (or versions of items) left in a repository. After that, Veeam Backup for Microsoft Office 365 completely removes such a repository from the hard drive.
Removing Unresolved Data
If a backup job fails to resolve organization mailboxes, SharePoint or OneDrive items, Veeam Backup for Microsoft Office 365 preserves the latest backup state until the next successful backup of such a mailbox, SharePoint or OneDrive item is created.
The following is an example that demonstrates a backup of the mailbox A which is followed by 6 consecutive unsuccessful attempts (B though G) of backing up that same mailbox during subsequent backup job sessions. In such a scenario, the mailbox A will not be removed until this mailbox is successfully backed up during the attempt H.
Removing Restore Points
Each version of an item can have its own restore points. The restore points of items are removed as soon as they are out of the retention coverage. Once the latest available restore point is removed, the parent item of such a restore point will be removed as well.
Consider the following example with four items (A through D) and two restore points (A1 and A2) both of which belong to the item A. The A1 restore point has already been removed since it was out of the retention scope, whereas the A2 restore point will only be removed after it goes out of the retention coverage (Example 1).
Once the latest restore point is out of the retention scope and, therefore, can safely be removed, the item A — the parent item of the latest restore point A2 — will be removed as well (Example 2).
Backup Job Idleness
If a backup job has created a successful backup and then went idle for an indefinite period of time (for example, it might have become disabled), then all the data created by such a job will be removed once it is out of the retention coverage.
The following is an example in which the mailbox A has been removed because it was already out of the retention scope (Example 1), and the next mailbox to be removed is the mailbox B, the removal of which will happen once it goes beyond the retention coverage (Example 2).
The same is applicable to Microsoft SharePoint and OneDrive for Business.