Sunday, 6 December 2020

File server migration to SharePoint online using SPMT PowerShell Part 1

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.

 

Issue

We faced below issues in this requirement:

  1. The documentation for this is not that accurate or in single place. We need to search here and there for things.
  2. 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.
  3. 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.

 

Solution -

 

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:

  1. Do not include a header row in your CSV file.
  2. Remember to account for all six columns in the file, even if you are not needing a value for a given field.
  3. 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:

Source,SourceDocLib,SourceSubFolder,TargetWeb,TargetDocLib,TargetSubFolder


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

For example,

C:\MigrationTests\testfiles,,,https://contoso.sharepoint.com/sites/Sample/,DocLibraryName,DocLibraryName_subfolder

 

In case, you don’t want to migrate it to sub folder, the subfolder part will be blank

File server path,,, TargetWeb,TargetDocLib,

For example,

C:\MigrationTests\testfiles,,,https://contoso.sharepoint.com/sites/Sample/,DocLibraryName,

In next blog we will use this csv in the PowerShell.

Reference:
  1. https://docs.microsoft.com/en-us/sharepointmigration/how-to-format-your-csv-file-for-data-content-migration#:~:text=number%20of%20tasks.-,Using%20a%20comma%20separated%20value%20(CSV)%20file%20for%20data%20content,to%20create%20the%20CSV%20file

1 comment: