Calendars

Bacula Enterprise Microsoft 365 Plugin can protect M365 Calendars associated to users or groups:

  • Groups on M365 have only one calendar assigned, without the possibility to add more

  • Users can utilize calendar selection features using the files* parameters. Target users can also be customized using user* parameters.

It is important to note that the Calendar of a group can only be accessed using delegated permissions. Delegated permissions mean the plugin will impersonate a logged in user in order to access the required information. Therefore, to backup a calendar of a group, the logged in user needs to belong to that group.

The information protected with this module is detailed below:

  • For Users:

    • Calendar Groups

    • Calendars

      • Events (Metadata and contents)

        • Master events are backed up only once

        • Restoring master event results in the application of all event instances

      • Attachments

        • File Attachments

        • Item Attachments

        • Reference Attachments

  • For Groups

    • Calendar

      • Events (Metadata and contents)

        • Master events are backed up only once

        • Restoring master event results in the application of all event instances

      • Attachments * File Attachments * Item Attachments * Reference Attachments

      • Calendar for groups uses Delegated permissions

Calendar module includes the following features:

  • Incremental backup (it is done without Delta function)

  • Multilevel-attachments:

    • M365 supports having messages or event objects as the attachment of a given message object. Those attachments can present additional attachments. This situation is what the M365 Plugin considers multilevel-attachments. Some particular objects like Files, when present in this multilevel way, are embedded in the metadata of the message attached. This implies that the plugin must get them in a single HTTP call and load them entirely in memory. If there is not enough memory available on the system, the variable multilevel_attach can be disabled and those objects will be ignored.

    • Multilevel attachmets are backed up at the same level. This means that a message with this structure:

      • Base Event have 1 Event-Attachment, Event Attachment 1 has a Message Attachment 2, and Message Attachment 2 has a File attachment

      • When restored, the result will be all Attachments being restored to the same level, not one inside the another as they were originally. For example:

      • Base Event

        • Event-Attachment 1

        • Message-Attachment 2

        • File Attachment

Catalog structure for Calendar and Events presents the same structure as the Email module (changing ‘email’ for ‘calendar’ in the path ; event extensions are .evt in comparison to the .msg extension of messages). For more information, please check section 4.2 Email/Mailboxes

Backup parameters

The list below shows the specific backup parameters that can be set up in order to control the behavior of the calendar module.

In order to select the calendar module, the common service parameter must be equals or be containing the value calendar.

Entities that can include calendars are: users (calendar groups, calendars and events) and groups (one calendar and events).

Option

Required

Default

Values

Example

Description

calendar_files

No

Strings representing existing calendars for the given users or groups separated by ‘,’

Holidays, Meetings

Backup only specified calendars belonging to the selected entities (Users, Groups, Sites..)

calendar_files_exclude

No

Strings representing existing calendars for the given users or groups separated by ‘,’

Trainings, TeamBeer

Exclude selected calendars belonging to the selected entities

calendar_files_regex_include

No

Valid regex

.*Company

Backup matching calendars. Please, only provide list parameters (files + files_exclude) or regex ones. But do not try to combine them.

calendar_files_regex_exclude

No

Valid regex

.*Plan

Exclude matching calendars from the selection. Please, only provide list parameters (files + files_exclude) or regex ones. But do not try to combine them. If this is the only parameter found for selection, all elements will be included and this list will be excluded.

calendar_multilevel_attach

No

Yes

0, no, No, false, FALSE, false, off ; 1, yes, Yes, TRUE, true, on

No

Include multilevel attachments in backup. A multilevel attachment is, for example, a message attached to a message containing more elements attached inside. Under certain circumstances, multilevel attachments could imply higher memory needs, as some of them are embedded in the metadata of the objects to backup, so they need to be caught in a single call and be loaded entirely in memory. This parameter is intended to control the behavior against that situation.

calendar_exclude_attachments

No

No

0, no, No, false, FALSE, false, off ; 1, yes, Yes, TRUE, true, on

Yes

Exclude any attachment from backup

Note

In previous versions it was possible to use files_* parameters instead of calendar_files* parameters,. These parameters are now deprecated. We recommend to use module specific parameters in order to have better control and more possibilities inside a single fileset. However, jobs using files_* parameters will still work.

Restore

The list below shows the subset of restore parameters that can be used to control the behavior of calendar module restore operations:

  • destination_user, destination_group, destination_path, send_report, allow_duplicates

  • restore_share_permissions, calendar_name, debug, foreign_container_generation

Use cases

The following restore scenarios are supported:

  • Restore calendars, events, or attachments to the original user or to a different user

    • Restore parameters implied: destination_user

  • Restore calendars, events, or attachments to the original calendar group or to a different calendar group

    • Restore parameters implied: destination_path

  • Restore calendars, events, or attachments to the original calendar or to a different calendar

    • Restore parameters implied: calendar_name

  • Restore calendars, events, or attachments to local file system (general restore where parameter must be set to a path)

  • It is possible to control whether or not duplicate elements are allowed (based on file id):

    • Restore parameters implied: allow_duplicates

Particularities:

  • If no destination_user is set, every event will be restored into its original calendar

  • If no calendar_name is set, every event will be restored into its original calendar

    • If the selection contains events from several users:

      • Original user messages will be restored in their original location

      • For other users, a special calendar will be created with the email address of each of them in the name, unless the parameter foreign_container_generation is disabled

        • If foreign_container_generation is disabled, a calendar with the same name present in the original user will be looked for in the destination user, if it does not exist, an error will be triggered

    • Restored elements will be duplicated by default, unless the allow_duplicates variable is disabled

      • Even disabling that variable, events will be checked by id. So if there is an element with the same information but a different ID, it will not be considered to be a duplicate

For more details about the behavior of each parameter, please check the general section of restore parameters.

Fileset examples

Backup all calendars of one user:

Fileset Example
FileSet {
   Name = fs-m365-calendar-adelev
   Include {
      Options { signature = MD5 }
      Plugin = "m365: service=calendar tenant=57uia43-d107-17a2-a2g2-aa53c10tdahc objectid=56ddf1h9-
   eb5d-42nf-bac7-7b019fd284g5 user=adelev@baculaenterprise.onmicrosoft.com"
   }
}

Backup all calendars from all users or groups:

Fileset Example
FileSet {
   Name = fs-m365-calendar-all
   Include {
      Options { signature = MD5 }
      Plugin = "m365: service=calendar tenant=57uia43-d107-17a2-a2g2-aa53c10tdahc objectid=56ddf1h9-
   eb5d-42nf-bac7-7b019fd284g5"
   }
}

Backup all calendars from a group:

Fileset Example
FileSet {
   Name = fs-m365-calendars-dev-team
   Include {
      Options { signature = MD5 }
      Plugin = "m365: service=calendar tenant=57uia43-d107-17a2-a2g2-aa53c10tdahc objectid=56ddf1h9-
   eb5d-42nf-bac7-7b019fd284g5 group=\"Dev Team\" "
   }
}

Backup only one calendar of some users:

Fileset Example
FileSet {
   Name = fs-m365-calendar-2user-inbox
   Include {
      Options { signature = MD5 }
      Plugin = "m365: service=calendar tenant=57uia43-d107-17a2-a2g2-aa53c10tdahc objectid=56ddf1h9-
   eb5d-42nf-bac7-7b019fd284g5 group="Dev Team,Marketing team" calendar_files=CompanyCal"
   }
}

Activate backup of multi-level attachments:

Fileset Example
FileSet {
   Name = fs-m365-calendar-multilevel-attach
   Include {
      Options { signature = MD5 }
      Plugin = "m365: service=calendar tenant=57uia43-d107-17a2-a2g2-aa53c10tdahc objectid=56ddf1h9-
   eb5d-42nf-bac7-7b019fd284g5 user="peter@mycompany.com,miriam@mycompany.com" calendar_multilevel_attach=yes"
   }
}