Recently we have a project where we need to migrate file server to SharePoint Online. So, we decided to go with SharePoint Migration Tool (SPMT). But we had 50 plus folders and all were needed to migrate to different sites documents library. As it takes long time to migrate using tool due to creating connection, we decided to use PowerShell version.
We faced below issues in this requirement:
- The documentation for this is not that accurate or in single place. We need to search here and there for things.
- SPMT tool migrates file server child items directly but when you use PowerShell, it migrates parent folder. Due to curse of first point, it took some time for us to find the hidden solution. Go through this post to see that hidden gem.
- The last but no least is permission migration. SPMT has all this functionality but as I said earlier it is not documented well.
So, we will try to explain all our knowledge in detail here.
First, we need to prepare a csv which will be read by PowerShell and It will have connection details of source and migration.
important notes for preparing csv:
- Do not include a header row in your CSV file.
- Remember to account for all six columns in the file, even if you are not needing a value for a given field.
- If you use the standard out-of-the-box Document library ("Shared Documents"), you must use the Display name "Documents" as the placeholder value for the Target Document Library in your CSV file. If you enter "Shared Documents" in that column, you will receive an "invalid document library" error.
Note - If the language of the destination SharePoint site is other than English, check the Display name of the "Shared Documents" Document library by browsing to Documents library.
The format of csv is as below:
As we are migrating from file server, we will not pass the “SourceDocLib” & “SourceSubFolder” details. So, our csv detail will look like below:
File server path,,, TargetWeb,TargetDocLib,TargetSubFolder
In case, you don’t want to migrate it to sub folder, the subfolder part will be blank
File server path,,, TargetWeb,TargetDocLib,
C:\MigrationTests\testfiles,,,https://contoso.sharepoint.com/sites/Sample/,DocLibraryName,In next blog we will use this csv in the PowerShell.