Sam's Microsoft Dynamics 365 Blog

Friday, 21 February 2020

Migrate SharePoint On-Premises Content to SharePoint Online

In this article, we will discuss about Migrate SharePoint On-Premises Content to SharePoint OnlineSharePoint Online Migration PowerShell cmdlet is the a way of doing content migration without using a tool.


So, let's discuss step by step:

Prerequisites:-

  •     Azure Subscription
  •     Azure Storage Account
  •     Office 365 (SharePoint) Account
  •     SP Online Management Shell

Script:


Get-PSSnapin

Get-PSSnapin -Registered

Add-PSSnapin Microsoft.SharePoint.PowerShell

Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

Export-SPWeb -Identity "<onprem-site URL e.g. http://saddamk206>" -ItemUrl "/<Document library name e.g. MyDocuments>/" -Path "<temprary path e.g. C:\Migration\MyDocuments_Source" -NoFileCompression -IncludeVersions LastMajorAndMinor

$username = "samkhan@saddamk206.co.in"

$cred = Get-Credential $username

$sourceFiles = "<Source of Files e.g. C:\Migration\MyDocuments_Source>"

$sourcePackage="<Source of Package e.g. C:\Migration\MyDocuments_Source>"

$outputPackagePath = "<Output package path e.g. C:\Migration\MyDocuments_outputPackagePath>"

$targetWebUrl = "<online sharepoint site URL e.g. https://saddamk206.sharepoint.com/sites/mypersonalsite>"

$targetLibrary = "MyDocuments"

ConvertTo-SPOMigrationTargetedPackage -SourceFilesPath $sourceFiles -SourcePackagePath $sourceFiles -OutputPackagePath $outputPackagePath -TargetWebUrl $targetWebUrl -TargetDocumentLibraryPath $targetLibrary -Credentials $cred

$azureAccountName = "<Azure account name e.g. samstorate206>"

$azureAccountKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=="

$azurelocations=Set-SPOMigrationPackageAzureSource -SourceFilesPath $sourceFiles -SourcePackagePath $outputPackagePath -AccountName $azureAccountName -AccountKey $azureAccountKey

Submit-SPOMigrationJob -TargetWebUrl $targetWebUrl -MigrationPackageAzureLocations $azurelocations -Credentials $cred


Thanks for reading the article. Hope this Article will helpful for you. Cheers!!!

No comments:

Post a Comment

Web Resource vs PCF vs Canvas App - which of the one is used?

While started working on specific Business Requirements related to custom layout, there is a always common question that "where to star...