Commands › SharePoint Online

New-SPOMigrationPackage

SharePoint Online Microsoft.Online.SharePoint.PowerShell New-*

Cmdlet to create a new migration package based on source files in a local or network shared folder. > [!NOTE] > This cmdlet has been deprecated. To migrate to SharePoint and Microsoft 365 using PowerShell, see > Migrate to SharePoint using PowerShell.

Quick start script

# New-SPOMigrationPackage — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-SPOMigrationPackage
$before | Format-List

# 3. Make the change
New-SPOMigrationPackage -OutputPackagePath <String> -SourceFilesPath <String>

# 4. Verify and diff
$after = Get-SPOMigrationPackage
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

New-SPOMigrationPackage [-SourceFilesPath] <String> [-OutputPackagePath] <String> [[-TargetWebUrl] <String>]
 [[-TargetDocumentLibraryPath] <String>] [[-TargetDocumentLibrarySubFolderPath] <String>]
 [-IncludeFileSharePermissions] [-ReplaceInvalidCharacters] [-IgnoreHidden] [-NoLogFile] [-NoAzureADLookup]
 [<CommonParameters>]

Parameters (10)

ParameterTypeRequiredWhat it controls
-IgnoreHidden SwitchParameter Switch to ignore hidden files and folders.
-IncludeFileSharePermissions SwitchParameter Used to include permissions and sharing information into the generated manifest files in the package metadata.
-NoAzureADLookup SwitchParameter Switch to not lookup local user accounts in Microsoft Entra ID.
-NoLogFile SwitchParameter Used to not create a log file. The default is to create a new CreateMigrationPackage log file within the directory specified within the OutputPackagePath parameter.
-OutputPackagePath String yes The directory location where the output package metadata files will be saved. If the directory does not exist, it will be created.
-ReplaceInvalidCharacters SwitchParameter Switch to replace characters in file and folder names that would be invalid in SharePoint Online.
-SourceFilesPath String yes The directory location where the source content files exist. This directory will be enumerated to create the package metadata files.
-TargetDocumentLibraryPath String The web relative document library to use as the document library part of the base URL in the package metadata. If this is not supplied, "Documents" will be used within the package metadata instead.
-TargetDocumentLibrarySubFolderPath String Specifies the document library relative subfolder to use as the folder path part of the base URL in the package metadata. If this is not provided, no value will be used within the package metadata. The files will be...
-TargetWebUrl String The fully qualified web URL to use as the web address part of the base URL in the package metadata. If this is not provided, "`https://fileserver/sites/user`" will be used instead within the package metadata.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.