New File Share to SharePoint Migration Utility from Microsoft
Microsoft is releasing a new Powershell script to allow customers to upload files directly from a file share to a SharePoint document library. In addition, the script will allow files that have metadata to carry that metadata into SharePoint. The script was developed by the group responsible for the Windows Server 2008 R2 File Classification Infrastructure and supports both SharePoint 2007 and SharePoint 2010. If you are not familiar with the File Classification infrastructure, it allows organizations to assign classification metadata to files on a Windows Server 2008 R2 file server. For more on File Classification infrastructure see one of my earlier posts on this topic.
The business reason behind the script is that a lot of organizations still have thousands of documents on server file shares. At some point these organizations will want to migrate those files into SharePoint to make them more available for collaboration, and to facilitate management of the files. FCI allows organizations to assign metadata to all the files on a file server, and this new script will enable transfer of the files and the associated metadata into SharePoint.
The combination of FCI and SharePoint overcomes a major hurdle in using the full power of SharePoint -populating files with metadata. Metadata allows users to filter and search information in SharePoint in a much more powerful way, especially with SharePoint 2010 features such as navigation hierarchies and key filters. Many customers say they can get their files into SharePoint, but they have no idea how to assign metadata to all these files. FCI along with this new script allows organizations to overcome this hurdle.
Getting metadata into SharePoint provides benefits for user search and file disposition and can also be used to strengthen security via products like our Metadata Security for SharePoint.
The new script is called FciSharePointUpload.ps1 and is available from Microsoft at this download site.
The script provides two options:
Option 1: Upload a file to a SharePoint Library – SharePoint 2007, SharePoint 2010.
FciSharePointUpload.ps1 –file <file path> -url <target site> -libPath <relative library path> [-name <target name>] [-sourceAction {keep|delete|url}] [-targetAction {overwrite|skip|fail}] [-propertyAction {copy|ignore}] [-user <user name> -password <password>]
Option 2: Upload a file to SharePoint using the official file web service that is coupled with a content organizer (e.g.: Record center) – SharePoint 2010 only.
FciSharePointUpload.ps1 –useOfficialFileWebService –file <file path> -url <target site> [-name <target name>] [-contentType <content type name>] [-sourceAction {keep|delete|url}] [-propertyAction {copy|ignore}] [-user <user name> -password <password>] [-additionalProperties] <property list>
The parameters are as follows:
- file: path to the file to upload (required)
- url: URL to the SharePoint site (required). Example: -url ”http://sharepoint/sites/mariant”
- libPath: relative path to the document library within the site (required), Example: -path ”Shared Documents”
- name: name of the target file (optional). If not specified, it defaults to the source file name as specified by the “file” argument. Example: -name Test.docx
- contentType: name of the content type to use for the document (optional). If not specified, defaults to “Document”
- sourceAction: indicates how to handle the source file after a successful upload (optional) – 1) keep – leave the file in place (default) 2) delete: delete the file;3)url: replace the file with a shortcut to the uploaded document’s URL
- targetAction: specifies how to handle existing destination documents (optional) – 1) overwrite, replace (default) , 2) skip: leave existing version and continue , 3) fail: return error
- ropertyAction: specifies FCI property transfer mode (optional) – 1) copy: transfer properties (default) , 2) ignore: do not transfer properties, let SharePoint choose defaults
- user: user name to use for authentication (optional). The argument is ignored if “password” is not specified.
- password: password to use for authentication (optional). The argument is ignored if “user” is not specified.
- additionalProperties: list of extra properties to use for the document (optinal). The argument is followed by a space-separated list of strings. Each group of three strings is interpreted as the name, type and value of the property to add, in this order. The list size must be a multiple of three. These additional properties are always used, regardless of the propertyAction argument value. Example: -additionalProperties PII Boolean True BusinessImpact Choice High
Here is an example I created. I created a file share called "Merger". I then tagged all the files in this share with metadata property called CorpClassification, and a value of "CONFIDENTIAL" using FCI (you can’t actually see the metadata in the file system).

I then created a column called CorpClassification in a SharePoint library called Merger, and using the script I copied these three files into the SharePoint library. As you can see the metadata has been transferred with the files.

Be careful when creating the property and column type in FCI and SharePoint. These have to match up as per the script requirements, or the script will not work. In my case, the FCI property was of type "Choice", this means I had to create a column of type Choice – Checkboxes in SharePoint. If I tried to define any other column type (e.g Choice – Dropdown) the script will not work.

Charlie Puffer
Titus Labs
Charlie is a co-founder of Titus Labs and has been at Titus Labs since its inception in 2003. He was the driving force behind the early development of the Titus Labs desktop classification products for Microsoft Office. Most recently he acted as the product management lead for the development of the Titus Labs SharePoint products. In this role Charlie has developed in-depth knowledge of SharePoint document management as well as its metadata capabilities.
How does it handle filenames with illegal characters or that exceed the 256-character URL limit?
Do you agree?
0
0
Very interesting, thanks for the post Charlie. The file server/SharePoint debate will continue and it’s nice to have better tools like PowerShell for migration when needed.
As an admin I see users posting everything not wanting to take time to first organize and classify (the dump approach). I’m not interesting in poor SharePoint search results from sloppy uploads. That said bulk migrations can be great and helpful at times for sure.
It’s a balancing act. The right tool for the goal. And there’s room for both. I don’t want VHD or ISO files on SharePoint for example. Personally I like attrition strategies where we slowly retire an old system’s relevance by posting all new content elsewhere.
Cheers,
Jeff
Do you agree?
0
0
Eric,
If the script is unable to upload the file because characters are illegal etc, it will fail and leave the file on the file server
Do you agree?
0
0