Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Transcripts of video files, like those in Teams meeting recordings, are stored in a format similar to a zip file. If you are migrating videos from one source to another, you must use a new flag to ensure the entire zip file is migrated to the destination. Otherwise, you will inadvertently leave behind the alternate content stream, the transcript.
Step 1: Check if the file contains alternate content streams
- Check to see if the SPFile object has the property SPFile.HasAlternateContentStreams. Use the REST or CSOM API to fetch this property value.
- If set to True, the file contains alternate content streams.
Example:
GET https://{site_url}/_api/web/GetFileByServerRelativeUrl(‘/serverrelativeurl’)/HasAlternateContentStreams
Step 2: Download the file with alternate content streams
A zip formatted stream including primary and alternate streams can be downloaded if the file request includes SPOpenBinaryOptions.GetAsZipWithAltStreamsIfAvailable.
- Use REST or CSOM API to download the zip formatted content stream.
- You must include SPOpenBinaryOptions.GetAsZipWithAltStreamsIfAvailable. If this is not specified, only the primary file content stream is returned.
Example:
GET https://{site_url}/_api/web/GetFileByServerRelativeUrl(‘/serverrelativeurl’)/OpenBinaryStreamWithOptions(openOptions=1048576)
Note: In the example above, "1048576" corresponds to the integer value of enum SPOpenBinaryOptions.GetAsZipWithAltStreamsIfAvailable.
Step 3: Import the file with alternate content streams
Use the Migration API to import the zip formatted stream for a file with alternate content streams to SPO. The main steps involved are:
- Upload the zip formatted stream downloaded with SPOpenBinaryOptions.GetAsZipWithAltStreamsIfAvailable as the primary file to the Azure location.
- When preparing the migration Manifest .xml file, add the property vti_hasAlternateContentStreams to the SPFile object with the value of TRUE.
- Call the Migration API as normal. Internally, SPO will unzip the provided content stream and set the primary file stream and associated alternate content streams correctly.
- After the import, verify the property SPFile.HasAlternateContentStreams to confirm if it’s set to True.
Example:
<SPObject Url="Shared Documents/TestTMR.mp4" ObjectType="SPFile" Id="72b62f15-24be-4a8d-8023-ed7c4feae8c9"….>
<File Url="Shared Documents/TestTMR.mp4" ParentWebUrl="/" … Name="TestTMR.mp4">
<Properties>
<Property Name="vti_hasAlternateContentStreams" Value="TRUE" Access="ReadWrite" Type="Boolean"/>
</Properties>