1

I have saved a list template with content from a Sharepoint 2010 enterprise site on Server A and migrated the list template and content to a Sharepoint 2010 enterprise site on Server B. After doing so, the list and content all appear fine except for the fields containing people's name from the "people picker" field.

When hovering over the name in the list view for both environments, I get the following URL with ID: ie:

http://contoso/_layouts/userdisp.aspx?ID=585

My problem is that ID=585 = BOB JONES in Server A and JOHN SMITH IN Server B. So now the migrated list and content have the wrong individuals listed in the new environment.

The list on Server A shows Bob Jones in a people picker field, and shows John Smith on the same field on Server B.

There are too many list items to manually edit each item and datasheet view won't allow me to edit people picker content.

  • Does this only occur with users that are in Server A but not in Server B? If the user was indeed in both environments, is it mapped correctly? – tyshock Feb 3 '14 at 20:56
  • It is actually isolated only for this specific list I migrated from server A to server B. The users listed in the list from A are completely different and incorrect when transferred to server B. I have migrated multiple lists with content from server A to B and none have had this issue. – Haroun A. Feb 5 '14 at 17:24
3

Looks like the issue is with the UserInfo list ID. Can you export the list data and store the User as ID or Email? Then when you import the info call EnsureUser. This will re-associate the user with his correct (or new) userID record in the new site collection.

  • Hi Matthew, Thanks for your answer can you specify how I can achieve exporting the list and storing the User as ID or email? Is there a Powershell Script out there that can do this? – Haroun A. Feb 3 '14 at 17:15
  • Not off the top of my head, check Gary Lapointe's site falchionconsulting.com/PowerShellViewer/Default.aspx Essentially you can grab the SPPerson object and then get the email or login attribute. – Matthew McDermott Feb 3 '14 at 23:36
3

I may be wrong, but I don't think there is an easy/elegant way to fix this without some sort of code. The easiest way to fix this, IMO, would be a post-import powershell script which iterates each item of the list, and for each field that needs a fix-up, it reassociates it with it's correct user. If you could get an export of the original site's id/username pairs, then this should be a fairly straightforward process.

The following powershell dumps all users for all sites to the STDOUT. Of course, you can modify to just dump the site collection that you are concerned about.

$sites = Get-SPSite -Limit ALL

foreach($site in $sites) {

    $groups = $site.RootWeb.sitegroups

    foreach ($grp in $groups) { 
        foreach ($user in $grp.users) { 
            $user.UserLogin + ':'+ $user.Id 
        }
    }
}
  • Thanks tyshock for your post. Any idea how I can get an export of the site's id/username pairs? Doesn't seem like this is a common task based on my research. – Haroun A. Feb 5 '14 at 17:26
  • I edited my answer.... – tyshock Feb 5 '14 at 21:26
0

I figured out my issue. Simply saving the list as template with content does not carry over or "includeusersecurity" to a new server/environment.

I simply used powershell to export the list and then import the list to the new server. See powershell script below:

#This is the source web that is hosting the lists to move
$sourceWebUrl = "`http://serverA/exampleSite`"

#This is the destination web, where the lists will be copied to
$destWebUrl = "`http://serverB/exampleSite`"

#Location to store the export file
$path = "\\fileserver\folderName\Intranet Stuff\"

#comma delimited list of List Names to copy. 
#Valid input here is a comma delimited list of List Names (taken from Site Settings->Web Address->URL portion after "/Lists/" in quotes.
$lists = @("Issue Tracking")

$libraryflag = $false

#Loop through the lists, export the list from the source, and import the list into the destination
foreach($list in $lists)
{
     "Exporting " + $sourceWebUrl + "/lists/" + $list
     IF ($libraryflag -eq $true)
     {
         export-spweb $sourceWebUrl -ItemUrl ($list) -IncludeUserSecurity -IncludeVersions All -path ($path + $list + ".cmp") -nologfile -force
     }
     ELSE
     {
        export-spweb $sourceWebUrl -ItemUrl ("lists/" + $list) -IncludeUserSecurity -IncludeVersions All -path ($path + $list + ".cmp") -nologfile -force
     }

     "Exporting complete."



    "Importing " + $destWebUrl + "/lists/" + $list

        import-spweb $destWebUrl -IncludeUserSecurity -path ($path + $list + ".cmp") -nologfile

     "Importing Complete"
    "`r`n`r`n"
}
  • What's the purpose of $libraryflag? – user22303 Apr 15 '14 at 20:19
0

The code contains some errors. Here is the one that should work :

#This is the source web that is hosting the lists to move
$sourceWebUrl = "http://serverA/exampleSite"

#This is the destination web, where the lists will be copied to
$destWebUrl = "http://serverB/exampleSite"

#Location to store the export file
$path = "\\fileserver\folderName\Intranet Stuff\"

#comma delimited list of List Names to copy. 
#Valid input here is a comma delimited list of List Names (taken from Site Settings->Web Address->URL portion after /Lists/ in quotes.
$lists = @("Issue Tracking")

$libraryflag = $false

#Loop through the lists, export the list from the source, and import the list into the destination
foreach($list in $lists)
{
     "Exporting " + $sourceWebUrl + "/lists/" + $list
     IF ($libraryflag -eq $true)
     {
         export-spweb $sourceWebUrl -ItemUrl ($list) -IncludeUserSecurity -IncludeVersions All -path ($path + $list + ".cmp") -nologfile -force
     }
     ELSE
     {
        export-spweb $sourceWebUrl -ItemUrl ("lists/" + $list) -IncludeUserSecurity -IncludeVersions All -path ($path + $list + ".cmp") -nologfile -force
     }

     "Exporting complete."



    "Importing " + $destWebUrl + "/lists/" + $list

        import-spweb $destWebUrl -IncludeUserSecurity -path ($path + $list + ".cmp") -nologfile

     "Importing Complete"
    "`r`n`r`n"
}
  • What was the error in the previous answer?? – Karthik Jaganathan Jan 31 at 13:45
  • The problem was with the quotes / double quotes. – Enis Abazovic Feb 1 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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