Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

The export / import operations seems to be working quite well except for lookup columns. The lookup columns and other columns associated with the lookup are all empty.

Is this a limitation? Is there any script or tool that can overcome this?

Here's my code:

#This is the source web that is hosting the lists to move
$sourceWebUrl = "http://servername/subsite"     
#This is the destination web, where the lists will be copied to
$destWebUrl = "http://servername/sites/subsite"

#Location to store the export file
$path = "\\servername\Backups\"

#comma delimited list of List Names to copy
$lists = @("list2", "list1")


#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

  export-spweb $sourceWebUrl -ItemUrl ("lists/" + $list) -IncludeUserSecurity -IncludeVersions All -path ($path + $list + ".cmp") -nologfile

  "Exporting complete."



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

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

  "Importing Complete"
  "`r`n`r`n"
 }

Source taken from http://blogs.msdn.com/b/jorman/archive/2011/01/08/copying-lists-with-powershell-in-sharepoint-2010.aspx

share|improve this question
    
possible duplicate of Export Import Library with Lookup column –  Vedran Rasol Sep 26 '11 at 8:31
add comment

2 Answers

up vote 3 down vote accepted

After migration lookup columns lost relations because list GUIDs they are using are different. This cannot be avoided and this is main disadvantage of using export/import based migration.

Here you can find known issues when using import/export:

share|improve this answer
add comment

I have had the same problem (empty lookup fields) after importing libraries. But I could easily solve this problem by changing the order of importing the libraries. At firts I had to import the library which was referenced by the others. Of course this works best with a limited number of libraries, so that you have an overview of which library is referenced by another one.

Hope this helps,

many greetings from Bavaria (Oktoberfest is over now :-() )

Max

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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