Command
Import-BoxDocument
Description
The command to import Box documents to a SharePoint library.
Tips:
You will find how to adapt any Import-BoxDocument script to perform an incremental migration in the Incremental update using PowerShell article.
To learn how to replicate your copy options from ShareGate Migrate in your script click here.
If you experience considerable performance issues, see Box.com throttling.
Index
Examples
Import all documents
$box = Connect-Box -Email [email protected] $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-BoxDocument -Box $box -DestinationList $dstList
Import all documents from another user in Admin mode
$box = Connect-Box -Email [email protected] -Admin $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-BoxDocument -Box $box -UserEmail [email protected] -DestinationList $dstList
Specify source and destination folders
$box = Connect-Box -Email [email protected] $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-BoxDocument -Box $box -SourceFolder "MyFolder/DocumentsToImport" -DestinationList $dstList -DestinationFolder "MyFolder/MySubFolder"
Specify source paths to import
$box = Connect-Box -Email [email protected] $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-BoxDocument -Box $box -DestinationList $dstList -SourceFilePath "MyFolder/DocumentsToImport/Document1.docx","MyFolder/DocumentsToImport/Document2.docx"
Import Documents with a Property Template
$propertyTemplate = New-PropertyTemplate -AuthorsAndTimestamps -VersionHistory -Permissions -NoLinkCorrection -FlattenFolders -VersionLimit 5 -CheckInAs Publish -ContentApproval SameAsCurrent -From "2012-01-01" -To "2012-12-31" $box = Connect-Box -Email [email protected] $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-BoxDocument -Box $box -SourceFolder "MyFolder/DocumentsToImport" -DestinationList $dstList -Template $propertyTemplate
Import Documents with property mappings.
$box = Connect-Box -Email [email protected] $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite $mappings = Get-PropertyMapping -Box $box -DestinationList $dstlist $mappings = Set-PropertyMapping -MappingSettings $mappings -Source "CustomData1" -Destination "CustomData1" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-BoxDocument -Box $box -DestinationList $dstList -MappingSettings $mappings
In this case, CustomData1 is custom metadata on certain Box files. They need to be mapped explicitly as Get-PropertyMapping does not go through all Box files in order to find all your Box fields.
Unmapped custom metadata ends up in the UnmappedCustomMetadata column which can be mapped to multiple lines of text field at the destination.
Import all documents PreCheck
$box = Connect-Box -Email [email protected] $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-BoxDocument -Box $box -DestinationList $dstList -WhatIf
Syntax
These are sets of compatible parameters for the Import-BoxDocument command.
Import-BoxDocument-Box <BoxInfo>-DestinationList <List>[-UserEmail <String>][-DestinationFolder <Uri>][-SourceFolder <Uri>][-TemplateName <String>][-NormalMode <SwitchParameter>][-WaitForImportCompletion <SwitchParameter>][-WhatIf <SwitchParameter>][-CopySettings <CopySettings>][-MappingSettings <MappingSettings>][-TaskName <String>]
Import-BoxDocument-Box <BoxInfo>-DestinationList <List>-Template <PropertyTemplate>[-UserEmail <String>][-DestinationFolder <Uri>][-SourceFolder <Uri>][-NormalMode <SwitchParameter>][-WaitForImportCompletion <SwitchParameter>][-WhatIf <SwitchParameter>][-CopySettings <CopySettings>][-MappingSettings <MappingSettings>][-TaskName <String>]
Import-BoxDocument-Box <BoxInfo>-DestinationList <List>-Template <PropertyTemplate>-SourceFilePath <Uri[]>[-UserEmail <String>][-DestinationFolder <Uri>][-SourceFolder <Uri>][-NormalMode <SwitchParameter>][-WaitForImportCompletion <SwitchParameter>][-WhatIf <SwitchParameter>][-CopySettings <CopySettings>][-MappingSettings <MappingSettings>][-TaskName <String>]
Import-BoxDocument-Box <BoxInfo>-DestinationList <List>-SourceFilePath <Uri[]>[-UserEmail <String>][-DestinationFolder <Uri>][-SourceFolder <Uri>][-TemplateName <String>][-NormalMode <SwitchParameter>][-WaitForImportCompletion <SwitchParameter>][-WhatIf <SwitchParameter>][-CopySettings <CopySettings>][-MappingSettings <MappingSettings>][-TaskName <String>]
Import-BoxDocument-Box <BoxInfo>-DestinationList <List>[-UserEmail <String>][-DestinationFolder <Uri>][-TemplateName <String>][-NormalMode <SwitchParameter>][-WaitForImportCompletion <SwitchParameter>][-WhatIf <SwitchParameter>][-CopySettings <CopySettings>][-MappingSettings <MappingSettings>][-TaskName <String>]
Import-BoxDocument-Box <BoxInfo>-DestinationList <List>-Template <PropertyTemplate>[-UserEmail <String>][-DestinationFolder <Uri>][-NormalMode <SwitchParameter>][-WaitForImportCompletion <SwitchParameter>][-WhatIf <SwitchParameter>][-CopySettings <CopySettings>][-MappingSettings <MappingSettings>][-TaskName <String>]
Parameters
-Box <BoxInfo>
Specifies the source Box.
Required? | True |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-CopySettings <CopySettings>
Specifies the copy settings.
Required? | False |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-DestinationFolder <Uri>
Specifies the folder path at the destination. Note: This parameter cannot be used to create new folders at the destination.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-DestinationList <List>
Specifies the destination list.
Required? | True |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-MappingSettings <MappingSettings>
Specifies the mapping settings.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-NormalMode <SwitchParameter>
Specifies that the normal mode should be used.
โNote: Insane mode is always used by default in PowerShell.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-SourceFilePath <Uri[]>
Specifies the source file path.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | TemplateSourceFilePath, TemplateNameSourceFilePath |
Aliases | None |
-SourceFolder <Uri>
Specifies the folder path at the source.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Default, Template, TemplateSourceFilePath, TemplateNameSourceFilePath |
Aliases | None |
-TaskName <String>
Specifies a name for the task.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-Template <PropertyTemplate>
Specifies the property template. To use the built-in "Full Copy" template, do not specify this parameter.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Template, TemplateSourceFilePath, TemplateExcelFilePath |
Aliases | None |
-TemplateName <String>
Specifies the property template to use by its name. You can use Sharegate to configure property templates for the specified list (see Import Property Mapping or New Property Template). To use the built-in "Full Copy" template, do not specify this parameter.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Default, TemplateNameSourceFilePath, TemplateNameExcelFilePath |
Aliases | None |
-UserEmail <String>
Specifies the user account from which to migrate. If the parameter is not set, the logged-in user's files will be imported. You must be connected as an administrator in order to use this parameter.
Required? | False |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-WaitForImportCompletion <SwitchParameter>
Specifies that the command will wait for azure insane mode import to be completed.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-WhatIf <SwitchParameter>
Specifies that a pre-check will be executed instead of a migration. For more information, see Run a Pre-Check in PowerShell.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |