Item versions
OneDrive and SharePoint can be configured to retain the history for files/items. Depending on the service and configuration, a new version can be created for each edit, each time the file is saved, manually, or never. Previous versions of a document may be retained for a finite period of time depending on admin settings which may be unique per user or location. This feature is usually enabled and the information may be accessed through the ‘Version history’ option available once a file has been selected.
Bacula Enterprise Microsoft 365 Plugin is able to backup this information if a special drive_version_history. backup parameter is activated.
Versions are backed up in a special way:
They are backed up as a regular file. This means a version has its own full metadata as the parent file itself has. All the metadata is the same as the file contains, except for size, dates and name.
The name of the file is modified, so at restore time you can see the version number and the version date in the filename. Example:
Parent file: myDoc.doc
Versions:
myDoc###v25.0_2021-01-19_234537.doc
myDoc###v24.0_2021-01-17_212537.doc
myDoc###v23.0_2021-01-12_104537.doc
…
*Notice that the extension of the file is kept in order to easily identify a possible name modification in OneDrive, once the file is restored
Versions are not restored by default. You need to disable the special restore parameter ‘drive_skip_versions’, setting it to 0.
File versions are backed up in all backup levels (Full, Incremental, Differential), this means you can track all the changes of the files in your backup. For example, every Incremental run is going to backup only the new modified versions since the last Full or Incremental execution.
Here is an example of a file backed up, listed in a restore session:
Automatically selected FileSet: FS_M365_DRIVE
+-------+-------+----------+-------------+---------------------+-------------------+
| jobid | level | jobfiles | jobbytes | starttime | volumename |
+-------+-------+----------+-------------+---------------------+-------------------+
| 11 | F | 190 | 332,978,505 | 2021-01-22 10:39:34 | TEST-2021-01-22:0 |
| 12 | I | 1 | 550 | 2021-01-22 10:43:05 | TEST-2021-01-22:0 |
+-------+-------+----------+-------------+---------------------+-------------------+
You have selected the following JobIds: 11,12
Building directory tree for JobId(s) 11,12 ...
+++++++++++++++++++++++++++++++++++++++++++++++
188 files inserted into the tree.
You are now entering file selection mode where you add (mark) and
remove (unmark) files to be restored. No files are initially added, unless
you used the "all" keyword on the command line.
Enter "done" to leave this mode.
cwd is: /
$ cd @m365/baculaenterprise/users/adelev@baculaenterprise.onmicrosoft.com/drive/root:
cwd is: /@m365/baculaenterprise/users/adelev@baculaenterprise.onmicrosoft.com/drive/root:/
$ ls
Docs/
pluginTest.drive.deltaLink
sharedWithMe/
versionedSampleWeb###v1.0_2020-11-25_153507.html
versionedSampleWeb###v2.0_2020-11-25_153507.html
versionedSampleWeb###v3.0_2020-12-02_180612.html
versionedSampleWeb###v4.0_2020-12-02_180612.html
versionedSampleWeb###v5.0_2020-12-03_134422.html
versionedSampleWeb###v6.0_2020-12-02_180612.html
versionedSampleWeb.html
docVersioned###v1.0_2020-11-26_123244.txt
docVersioned###v2.0_2020-11-26_123244.txt
docVersioned###v3.0_2020-12-02_180613.txt
docVersioned###v4.0_2020-12-02_180613.txt
docVersioned.txt
$
Note
It is important to keep in mind that versions have no Delta function and cannot be filtered by date. Therefore, the process to decide if a version needs to be backed up or not requires the plugin to walk through all existent versions of a modified item. In some situations this could have some undesired impact on backup performance.