For a long time users have asked how to Transfer Or Migrate Data onto SharePoint Online From Your Local File Share, Or On-Premises SharePoint, Using PowerShell or the AzCopy Command-Line Utility.
There used to be a void of information but actually since 2015 there has been a way to do the job, in this post I will list two:
1 . By using plain PowerShell (for small data sets up to 4 Gb, there is no need for purchasing an Azure subscription when using this method) :
Install the latest version from SharePoint Online Management Shell
Connect to SharePoint Online PowerShell
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
Refer to this article:
Upload on-premises content to SharePoint Online
And here is a Sample Script, to Migrate-FilesLessThan4GB, use it at your own risk:
$sourceFiles = Read-Host "Enter the path to the files you want to migrate"
$sourcePackage = Read-Host "Enter the path to a dedicated folder the script can use to hold temporary data"
$targetPackage = Read-Host "Enter the path to a different dedicated folder the script can use to hold temporary data"
$targetWeb = Read-Host "Enter the URL to the target web"
$targetDocLib = Read-Host "Enter the Document Library Name"
2. By using the AzCopy Command-Line Utility to transfer data (This more complex method might be more reliable when transfering large ammounts of data*, it requires Azure subscription / Azure Storage Account):
Download and install the latest version of AzCopy.
*Size Limitations Note:
Note that the minimum possible value for option
/SplitSize is 32MB. If the specified destination is Blob storage, AzCopy will split the data file once its sizes reaches the blob size limitation (200GB), regardless of whether option
/SplitSize has been specified by the user.
Refer to article Transfer data with the AzCopy Command-Line Utility
This guide assumes that you are already familiar with Azure Storage. If not, reading the Introduction to Azure Storage documentation will be helpful. Most importantly, you will need to create a Storage account in order to start using AzCopy.
AzCopy is a Windows command-line utility designed for copying data to and from Microsoft Azure Blob, File, and Table storage using simple commands with optimal performance. You can copy data from one object to another within your storage account, or between storage accounts.
Lastly, there is an excellent blog from Nishant Shah describing how to do it, just be sure to use the new cmdlet “Invoke-SPOMigrationEncryptUploadSubmit” instead of the the old cmdlet "Submit-SPOMigrationJob" and, upgrade the Sharepoint Online Management Shell to the latest version if needed:
Migrate to SharePoint Online (O365–SPO) from On-Premise SharePoint or fileshare using new PowerShell migration APIs
I hope you found this useful.
I whish you a nice and productive day !
Hélio de Andrade