Friday, October 8, 2010

Export and import of list does not move permissions and security

My requirement was to migrate a list with more than 3000 records and many folders from one site collection to another. Both the list and its folders had unique permissions assigned to it.

My first attempt was to save the list as template with data, and to create the list in my target site using the template. The list was migrated along with its data, but permissions on the list were not. The new list was still inheriting permissions from the parent site.
I then tried using the power shell command "export-spweb", since this command had a parameter "-IncludeUserSecurity", which when set, was supposed to move the list along with the permissions. However, this did not work out either. Looks like a bug with the command.

Resolution:

The solution that worked for me was to use a power shell extension cmdlet developed by Gary Lapointe, a Microsoft MVP.

Here are the steps:

1)  Download and deploy the Cmdlet WSP from here http://stsadm.blogspot.com/2009/02/downloads.html

2)  Use the following power shell commands to deploy the extensions:

Add-SPSolution C:\xxxx\Lapointe.SharePoint2010.Automation.wsp
Install-SPSolution -Identity Lapointe.SharePoint2010.Automation.wsp -GACDeployment

3) Once deployed, use the following command to migrate the list with permissions:

copy-splist -sourcelist "http://xxxx/lists/mylistname" -targetweb "http://xxxxxx/mysitename" -IncludeVersions All -IncludeDes
cendants All -IncludeUserSecurity

This worked like a charm!

No comments:

Post a Comment