Articles about European Sharepoint Hosting Service
SharePoint 2013 Hosting – HostForLIFE.eu : Migrate Files From Folder Share To SharePoint Online Using PowerShell
This tool allows you to migrate lists or files from your SharePoint on-premises document libraries or from your on-premises file shares and easily move them to either SharePoint or OneDrive in Office 365. It is available to Office 365 users.
In the latest version, Microsoft has introduced PowerShell cmdlets to perform migration that has all features of the SharePoint Migration Tool (SPMT).
Click here to download the SPMT latest version 2.1.100.0 (currently in open beta). The PowerShell .dll’s will be copied to %userprofile%\Documents\WindowsPowerShell\Modules location.
Copy the below script and paste it in a Notepad. Save the file as SPMTMigration.ps1.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# Module Location $Global:ModulePath = "C:\Users\Sharepoint\Documents\WindowsPowerShell\Modules\Microsoft.SharePoint.MigrationTool.PowerShell" # File Share Source Location $Global:FileShareSource = "C:\Users\Sharepoint\Desktop\DeploymentAutomation" # SharePoint Online Target Site Details $Global:SPOUrl = "https://c986.sharepoint.com/sites/dev" $Global:SPOCredential = Get-Credential $Global:ListName="Documents" # Import SPMT Module Import-Module ($modulePath + "\Microsoft.SharePoint.MigrationTool.PowerShell.psd1") # Create a migration session and initialize it Register-SPMTMigration -SPOCredential $Global:SPOCredential -Force # Add a new migration task to the registered migration session Add-SPMTTask -FileShareSource $Global:FileshareSource -TargetSiteUrl $Global:SPOUrl -TargetList $Global:ListName # Start the registered SPMT migration Start-SPMTMigration # Cancel the current migration session Stop-SPMTMigration # Remove the SPMT migration session created Unregister-SPMTMigration |
Open PowerShell window and run the following command.
1 |
>cd "<folderlocation>" |
folderlocation – where the SPMTMigration.ps1 file is saved
Run the following command
1 |
>.\SPMTMigration.ps1 |
Enter the SharePoint Online site credentials in the pop-up and enter OK. After a few minutes, the files from folder share will be migrated to SharePoint Online site.
Thus, in this blog, you saw how to migrate files from Folder Share to SharePoint Online using PowerShell based on the SharePoint Migration Tool (SPMT) migration engine.
Print article | This entry was posted by Peter on July 19, 2018 at 7:21 am, and is filed under European SharePoint 2013 Hosting. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |