SharePoint Online (OneDrive, Teams) target connector
The SharePoint Online target connector allows you to migrate to pre-configured sites. It consists of multiple flows, which are described below. To migrate content to SharePoint Online certain identifiers are required. The SharePoint Online source connector should be used to retrieve those identifiers.
Please note that it is crucial to use the same versions for both the SharePoint source and target connectors to maintain compatibility and avoid any potential issues during the migration process.
Features
- Creation of (custom) folders
- Creation of (custom) documents with their versions
- Creation of links (
.url
files for internal and external destinations) - Setting (custom) permissions on folders and documents
- Migrating to OneDrive
- Migrating to Teams*
Migration to pre-configured Teams channels, to the file section, is supported. Any other Teams functionality is not supported.
The following SharePoint field types are supported:
- Text (single and multiple)
- Choice (single and multiple)
- Number
- Currency
- Date and Time
- Lookup (single and multiple)
- Checkbox
- Managed metadata (single and multiple)
- Person or Group (single and multiple)
- The following document kinds are supported:
CONTAINER
,RECORD
,BINARY
andACL
. - The maximum supported file size by SharePoint Online is currently 250 GB.
- Document sets are officially not supported by the Microsoft Migration API which this connector uses. An event handler that is triggered when creating a document set through the UI is not triggered by the Migration API.
- By default, SharePoint tries to map metadata in the migrated document to columns in the library. For further information, please refer to the SPO system documentation
The following storages are supported for writing and reading migration packages & logs.
- File system
- cloud storage
When using a cloud storage, corresponding environment secret(s) must be set in the project to be able to connect to the specific cloud storage. See the documentation about cloud storages here.
For storing created migration packages, set flow variable pathOutput
in the accelerator SPO (3. Generate packages)
to: <cloud-storage>://<directory migration-packages>
.
For storing retrieved logs, set flow variable pathOutput
in the accelerator SPO (5. Monitor)
to: <cloud-storage>://<directory migration-packages>
.
Model
The SharePoint metadata is populated from the Content Store. Please carefully read this section, as it contains import information for the transformation of objects.
For the ROOT
documents an additional property needs to be set:
{
"migration" : {
// REQUIRED | STRING | this identifier should reference the `source.id` of a SPO object. These are stored by the SharePoint Online source connector with one of these content types: `documentLibrary`, `business` and `Folder`
"id" : "42ecf431-36e6-4fc2-8e34-df5680e01eb0",
// REQUIRED | BOOLEAN | only children of ROOT documents with this value set to 'true' will be created in SharePoint Online
"migrate" : true
},
// All the Content Store required fields + optional ones if needed. Fields will be mapped to their SharePoint Online counter part automatically.
"target" : {
// REQUIRED | STRING | this path should hold the value of source.hierarchies[0] from the SPO object that is referenced in `migration.id`
"hierarchies" : [
"/site/library[/folder]"
]
}
}
The schemas for CONTAINER
and RECORD
documents are described below with an explanation of how the fields are translated to the SharePoint Online fields.
{
"migration" : {
// REQUIRED | BOOLEAN | Only objects where this value is set to 'true' will be created in SharePoint Online.
"migrate" : true
},
"target" : {
// All the Content Store required fields + optional ones if needed. Fields will be mapped to their SharePoint Online counter part automatically.
"contentType" : {
// REQUIRED | STRING | this identifier should reference the source.contentType.systemName of a SPO content type. These are stored by the SharePoint Online source connector with content type: `ContentType`. When the displayName is provided, the connector will try to find the content type using that provided value. A random placeholder value can then be used for this field.
"systemName" : "0x0101009E09C19FBC18AC478E34E7DF96733DD9",
// OPTIONAL | STRING | this value should reference the source.contentType.displayName of a SPO content type. These are stored by the SharePoint Online source connector with content type: `ContentType`. When the displayName is provided it will be used instead of the systemName.
"displayName" : "Some Document"
},
"created" : {
"principal" : {
// OPTIONAL | STRING | this identifier should reference the `source.id` of a SPO user. These are stored by the SharePoint Online source connector with content type: `User`.
"systemName" : "cd5610a2-5abc-4ceb-805b-06fd28c71982"
}
},
"lastModified" : {
"principal" : {
// OPTIONAL | STRING | this identifier should reference the `source.id` of a SPO user. These are stored by the SharePoint Online source connector with content type: `User`.
"systemName" : "cd5610a2-5abc-4ceb-805b-06fd28c71982"
},
},
"properties" : {
// Any additional properties, using their technical property names defined in SharePoint Online.
// The technical name of a property can be found on the content type extracted by the SharePoint Online source connector in source.properties.columns[].name.
// When setting managed metadata properties, the path of the used term should be set as the property value. It can be retrieved from the source.hierarchies.0 value of a SPO term. These are stored by the SharePoint Online source connector with content type: `Term`.
// When setting lookup properties, the displayName of the used list item should be set as the property value.
// When setting person or group properties, the source.id of the used person or group should be set as the property value. These are stored by the SharePoint Online source connector with content types: `User` and `Group`.
// When multiple values have to be set an Array containing those values should be used as the value of the property.
// A versions's property value can be emptied by providing `null` as the value.
// Retention labels can be set by populating the display name of the label in a property named `_RetentionLabel_`.
}
}
}
SharePoint content types defined in a site and used in a library will have similar identifiers. The identifier of the content type in the library will start with the identifier of the content type in the site. For example, a site content type with identifier "abc" will have "abcdef" as an identifier in the library for that specific content type. The same is true for all content types that are derived from a content type. When you reference the content type identifier as known on the site, SharePoint will use any content type that starts with the same identifier in the library. For that reason, it is best practice to always reference library content type identifiers in your transformation.
Each record that represents an actual file should have exactly one binary document.
{
"target" : {
// All the Content Store required fields + optional ones if needed. Fields will be mapped to their SharePoint Online counter part automatically.
"properties" : {
// OPTIONAL | STRING | comments for the version
"checkinComment" : "Some comment",
// OPTIONAL | STRING | used when migrating the same file again with additional versions. It will overwrite the generated migration.id. See note below for an explanation on how to use this.
"migrationId" : "dc98eb3a597336bad16d9f35eceff22f"
}
}
}
SharePoint will throw an error when adding new versions to an already migrated document. In order to fix this, set the target.properties.migrationId
of the (new) current version BINARY
to the migration.id
value of the previously migrated current version BINARY
. Furthermore, set the target.properties.migrationId
of the previously migrated current version BINARY
to a new md5 hashed value.
When setting permissions on CONTAINER
and RECORD
documents, the ACL
schema should be used:
{
// All the Content Store required fields + optional ones if needed. Fields will be mapped to their SharePoint Online counter part automatically.
"target" : {
// REQUIRED | ARRAY | this value should reference the `source.name.systemName` of a SPO permission level. These are stored by the SharePoint Online source connector with content type: `permissionLevel`. Only the first permission in the array is used. For a description of the permissions please reference SharePoint Online: Site permissions -> Advanced permissions settings -> Permission Levels.
"permissions" : [
"Full Control"
],
// REQUIRED | ARRAY | this identifier should reference the `source.id` of a SPO user or group. These are stored by the SharePoint Online source connector with content types: `User` and `Group`
"principals" : [
{
"systemName" : "cd5610a2-5abc-4ceb-805b-06fd28c71982"
}
]
}
}
Flows
SPO (1. Prepare)
The first flow takes all ROOT
documents, and uses the migration.id
and target.hierarchies
values to search for the object in the exported SharePoint Online objects.
Using the information stored in that object, it sets the correct hierarchy value for all underlying objects and also the following identifiers used by the connector.
target.properties.spo.siteId
target.properties.spo.webId
target.properties.spo.webUrl
target.properties.spo.listId
target.properties.spo.listUrl
The migration.id
value is generated by the flow for each object based on the _id
value, and the full SharePoint Online URL for each object is stored in target.properties.spo.fullUrl
.
After generating the fullUrl
and documentID
, the flow processes the link objects and creates binaries for the migratable links in a format acceptable to SharePoint Online for .url
files.
In cases where the SharePoint Online Document ID service is enabled and the documentID
is set for the documents, the flow uses the documentID
as the reference for the internal in-scope destinations. If the documentID
is not available, the fullUrl
will be used as the reference instead.
Note:
The target.link.destination
of the link objects with the internal destination, should match the target.versionInfo.seriesId
of the internal destination, and the url will redirect to the current version of the destination file.
The target.name.systemName
and target.hierarchies
of the link objects, should have .url
extension, and this must be set in the transformation step, before running the SPO (1. Prepare)
accelerator.
Furthermore, content types, fields, managed metadata values and users/groups set on each object are validated.
Settings
mongoConnection
The Mongo connection string to connect to.
mongoConnectionExport
The Mongo connection string to connect to containing the exported SharePoint Online objects.
enableDocumentID
Enables setting the Document ID metadata field for each RECORD
with a value based on the migration.id
value of its BINARY
. Requires the SharePoint Online Document ID service to be enabled. Can either be true
or false
.
enableRetry
This mode can be used to retry migrating objects that failed to upload correctly to SharePoint. When enabled, only objects that have migration.flags.retry
set to true
will be processed by this flow. This migration flag will have to be set by the user on the desired objects, including their versions. Can either be true
or false
.
SPO (2. Import Document Sets)
Document sets and their ancestors are created by this flow using the REST API.
Modifier and modification date for document sets cannot be set by the used API. For the ancestors these metadata fields will be correctly set.
Settings
mongoConnection
The Mongo connection string to connect to.
sharepointUsername
The SharePoint Online account email address used to create the content. This account should have site administrator access.
sharepointPassword
The password belongs to the used SharePoint Online account. Do not use the password of the user if MFA is enabled, but use an app password instead.
The SharePoint username and password are required when using client credentials for authentication.