File revisions
Google Drive service can be configured to retain the history for files/items (this is versions or revisions of the same file).
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. By default, this feature is enabled and Google will store up to 100 revisions for each item and/or revisions younger than 30 days (they are deleted after 30 days).
This feature is usually enabled and the information may be accessed through the ‘Manage versions’ option available once a file has been selected.
Bacula Enterprise Google Workspace Plugin is able to backup this information if the special drive_version_history backup parameter is activated.
File revisions have some particularities compared to normal files:
They are backed up as a regular file. This means a revision has its own full metadata as the parent file itself. 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 GDrive, 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 some files backed up with revisions included, listed in a restore session:
cwd is: /@gw/XXXXX/users/jorge@baculasystems.com/drive/my drive/SOURCE_REGRESS_20220512104335/
$ ls
Contentiones/
Dolores###v_2022-05-12_104436729.doc
Dolores###v_2022-05-12_104444796.doc
Dolores###v_2022-05-12_104448264.doc
Dolores.doc
Dolores.doc__comments/
Legimus###v_2022-05-12_104518541.mp4
Legimus###v_2022-05-12_104527444.mp4
Legimus###v_2022-05-12_104530638.mp4
Legimus.mp4
Legimus.mp4__comments/
Netus.ppt
Posse###v_2022-05-12_104456414.docx
Posse###v_2022-05-12_104506748.docx
Posse###v_2022-05-12_104510261.docx
Posse.docx
Posse.docx__comments/
Ridiculus.jpeg
Note
It is important to keep in mind that versions have no Delta or Changes in special function on the API side 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.