Delta Backup
The Microsoft Graph API provides a Delta function to track changes of some objects. Bacula Enterprise Microsoft 365 Plugin uses this function in order to speed up Incremental/Differential processes. Please note that Delta function is not a mandatory requirement and that Incremental or Differential backups will function also with the services that currently do not support it.
Delta function has some important characteristics:
In OneDrive entities backup it can only be used for full entities (full user, full group, or full site). This means that selecting specific paths to backup will not trigger the Delta function.
Delta tokens can expire at some point, or even become invalid due to internal Microsoft issues. If this situation happens, the plugin will try to start a new Delta cycle
Any situation where the Delta function cannot be used will trigger a regular Full/Inc/Diff where every element is listed and selected or discarded according to the item dates.
The Delta backup cycle is described below:
Full backup: All entity elements are backed up. A token (token_1) is generated and this token is stored locally by the FD.
Incremental 1 backup: token_1 is used to retrieve changes since token_1’s generation so every change is backed up. A new token is generated and stored locally by the FD.
Incremental 2 backup: token_2 is used to retrieve changes since token_2’s generation so every change is backed up. A new token is generated and stored locally by the FD.
And so on…
Tokens are stored in an file placed in a path defined by the path parameter of the plugin. The name is: jobname.deltaLink
The file stores tokens required for every execution and it is renewed (emptied) during every Full backup execution.
This file is also backed up in the backup itself, so it can be restored manually, before an Incremental/Differential execution in case it was lost and in case you don’t want to run a Full backup again.
Services supporting Delta backup are: email, onedrive and contacts.
Here we can see an example of the contents of the file, with 3 executions and one user entity involved. The structure is tree-based, so it is easy to understand what would be generated in case of backing up other services or entities:
{
"jobName": "M365-DRIVE-ADELE-BACK",
"deltaServices": {
"DRIVE": {
"entities": {
"4bfec6ba-6e0c-455f-a86d-1dbfdd1c5754": {
"id": "4bfec6ba-6e0c-455f-a86d-1dbfdd1c5754",
"name": "adelev@baculaenterprise.onmicrosoft.com",
"containers": {
"b!7Tf3z7izSES7kjOHD-YM-0kScgNXL6lFnL4O2LWLMy41XlWc2E0pTKfPzlKxhztE": {
"id": "b!7Tf3z7izSES7kjOHD-YM-0kScgNXL6lFnL4O2LWLMy41XlWc2E0pTKfPzlKxhztE",
"description": "onedrive",
"deltaEntries": [
{
"job": "M365-DRIVE-ADELE-BACK.2021-04-13_13.42.42_21",
"date": "Apr 13, 2021 1:42:42 PM",
"delta":
"MzslMjM0OyUyMzE7Mzs5YzU1NWUzNS00ZGQ4LTRjMjktYTdjZi1jZTUyYjE4NzNiNDQ7NjM3NTM5MTA5NjczMzAwMDAwOzI4Nzc5ODY2ODslMjM
7JTIzaXRCQmNGclZjVGpya0x1YmZhdEpWWHpWdlolMjUyRkxPN1FJYmM4OXNGJTI1MkZZZkxZJTI1M0Q7JTIzMA"
},
{
"job": "M365-DRIVE-ADELE-BACK.2021-04-13_13.43.47_22",
"date": "Apr 13, 2021 1:43:47 PM",
"delta":
"MzslMjM0OyUyMzE7MTtjZmY3MzdlZC1iM2I4LTQ0NDgtYmI5Mi0zMzg3MGZlNjBjZmI7NjM3NTM5MTEwMzExNDAwMDAwOzI4Nzc5ODc2NDslMjM
7JTIzaXRCQmNGclZjVGpya0x1YmZhdEpWWHpWdlolMjUyRkxPN1FJYmM4OXNGJTI1MkZZZkxZJTI1M0Q7JTIzMA"
},
{
"job": "M365-DRIVE-ADELE-BACK.2021-04-13_13.44.39_23",
"date": "Apr 13, 2021 1:44:39 PM",
"delta":
"MzslMjM0OyUyMzE7MTtjZmY3MzdlZC1iM2I4LTQ0NDgtYmI5Mi0zMzg3MGZlNjBjZmI7NjM3NTM5MTEwODMwMTAwMDAwOzI4Nzc5ODg2MjslMjM
7JTIzaXRCQmNGclZjVGpya0x1YmZhdEpWWHpWdlolMjUyRkxPN1FJYmM4OXNGJTI1MkZZZkxZJTI1M0Q7JTIzMA"
}
]
}
}
}
}
}
}