SharePoint Migration Tool - multiple subfolders

Copper Contributor

I am using the SharePoint Migration Tool with a formatted csv file to migrate from a file share into a  SharePoint document library. 


The file share folder structure is in a simple 'client\matter' format.  This would normally be a simple migration task, however I only want to migrate certain matters for each client (i.e. closed matters).


Because the formatted CSV file only allows you to specify one subfolder level, I can't see a way for the matters to retain their folder structure.  For example, if I specify the 'client_a\matter_2' folder to be migrated to a SharePoint document library called 'client' under a subfolder called 'client_a', then all of the 'matter_2' files are copied to the root of the 'client_a' folder, rather than into a 'matter_2' subfolder.  I need each matter to have its own subfolder.


This is driving me crazy as it seems like it should be a simple task, so any help appreciated!

4 Replies

@Danbert  i'm amazed there is no traction on this post.  i have what i think is the same issue:






i want to migrate subfolder and it's contents


what's the syntax for the migrate by csv?


  • Column C: Enter the name of the subfolder in the document library. If this column is left empty, the migration starts from the root. If there is a value in this column, the migrations starts from the subfolder and down. Optional


this is unclear.  It states subfolder, not folder.  to me this is technically different. but it won't find the subfolder.  an error is thrown.  then when i try at the root 'folder' just to test, it sits at 0% for the progress.  HELP!


csv for migrate.PNG



Don't know if it helps but I successfully migrated documents from subfolder (i.e. folder/subfolder) level to the folder level in SPO.


The syntax for the source subfolder - 3rd column in CSV - was: foldername/subfoldername. The destination in my case was the folder name - 6th column in CSV: foldername.


It did not work at first but that had other reasons. SPMT was not able to create the destination structure of content types and fields. I found errors in the migration log. So it might be worth checking the log file. The solution for me was to create the destination structure using PnP provisioning so that SPMT didn't have to do this job anymore.

@heinrich-ulbricht  - thanks for the follow up!  I was able to figure it out but failed to follow up in this thread! 

I can confirm similar setup works.
Re: You cannot migrate to a deeper destination than first sub-folder
It is possible to copy to a sub level folder, simply create the task as a teams or sharepoint option (they both create the same job for the output json with only the 'TargetListRelativePath' being slightly different as teams, can select first sub folder in the UI, share point can only select the top level group in UI), then save as json, edit like the below and reload into the tool and run!

"Tasks": [
"SourcePath": "C:\\Path\\to\\Location",
"TargetPath": "",
"TargetList": "Documents",
"TargetListRelativePath": "General/TopLevelFolder/SubLevelFolder1/SubLevelFolder2",
"Settings": {
"DefaultPackageFileCount": 0,
"MigrateSiteSettings": 0,
"MigrateRootFolder": true