I have around 500 PDF files in a library that need to be moved to their corresponding document sets. The pdf file name contains the name of the document set. I am using SharePoint 2010.

For example R100666000111-0001.pdf would need to moved to the document set R100666000111

Can I create a workflow that would move the files from a specific folder in to the correct document set based on its fileName?

The document sets are created using a list workflow. Could the files be attached to the list somehow when I create the document sets? Or a seperate workflow when the pdf files are uploaded to the main folder?

If not a workflow, how could this be done?

  • Is it a one of job or regular? 500 pdfs or 0.5 millions and what is the total size?. If it is one off job, you can download the trial version of the migration tools available e.g. sharegate and migrate the content. Feb 18, 2016 at 16:59
  • Once a year. Each pdf is very small, 67kb. Feb 18, 2016 at 19:40
  • Okay so it is regular. I think PowerShell script might be able to help which you can run it as and when required. c-sharpcorner.com/blogs/… Feb 19, 2016 at 9:18

1 Answer 1


In such circumstances I would be running powershell script. Sure you can create a Site Workflow, but it's not the best way to handle .5 million items

Or you could combine and use powershell for now and setup the workflow to deal with files that will be uploaded later. Custom event receiver is also an option

Actually, powershell thing should be divided to two phases:

  1. List all PDFs as column A in CSV, making sure each destination docset exists, and saving its address as a column B in CSV
  2. Iteratively make simple 'move A to B' operation
  • Its only 500 (or less) pdf docs. How would you do this using a workflow? Feb 18, 2016 at 20:47
  • Ok, got it. Workflow itself is simple - make CAML query to get all PDFs' list item IDs to collection, then for-each ID: get file, calculate docset path, copy file to docset, delete item. This relies on fact that Document Sets are actually common Folders with some extensions. But the problem is SPD 2010 doesn't support loops natively and there's no built-in action like "move file" Feb 19, 2016 at 6:22
  • The problem with absent action can be solved with this - spdactivities.codeplex.com/… . And the first one is also solved, but it's really ugly. See sharepointgypsy.blogspot.com/2011/11/… and social.technet.microsoft.com/wiki/contents/articles/… . If you can use Visual Studio or 3rd party software (like Nintex Workflow 2010) to build a workflow, then it's much easier Feb 19, 2016 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.