Todd Bleeker's 12 Hive

All MindsharpBlogs

Are you pondering what I'm pondering?

My Links

Post Categories

Archives

Blog Stats

Crack Open a List Template STP to Retain Lookup Column Data

Have you ever wanted to copy a list that had a lookup field from a source Web to a destination Web using a custom list template (STP)? Even if the destination Web has a lookup list that exactly matches the source Web, the lookup field will be empty in any lists created using the STP. That is because lookup fields are related by GUID.

 

This is a common problem with custom list templates. The following steps describe the only workaround that I have discovered to this problem. They also assume that your destination Web already has a lookup list identical to the source Web. Replace [yourlist] with the name of the list you want to move.

 

01. Browse to the source Web's lookup list and choose Modify settings and columns.

02. Copy the source lookup list GUID from the URL.

03. Browse to the destination Web's lookup list and choose Modify settings and columns.

04. Copy the destination lookup list GUID from the URL.

05. Save the source Web's list that contains a lookup column to the lookup list as a list template called [yourlist].stp.

06. Export the list template STP from the source list template gallery to the file system.

07. Rename the [yourlist].stp file to [yourlist].cab so Windows can open it.

08. Open the file, right click on the manifest.xml file and export it to

the file system.

09. Edit the manifest.xml file; find the source Web's lookup list GUID and replace it with the destination Web's lookup list GUID.

10. Save the manifest.xml file.

11. Open a VS.NET command prompt.

12. Run the makecab command as follows:

    makecab manifest.xml [yourlist].stp

13. Import the new STP into the destination Web's list template gallery. You will need to delete it if it has previously been imported.

14. Create a new list based upon the new STP file.

 

The lookup column on the new list should retain all the data that was in

the source list.

 

HTH,

 

<Todd />

posted on Friday, November 11, 2005 7:47 AM

Feedback

# re: Crack Open a List Template STP to Retain Lookup Column Data 11/11/2005 9:30 AM Bob Mixon

Great stuff Todd, thank you!

# Workaround for Lookup field in SharePoint list templates 11/11/2005 10:45 AM Heather Solomon - MVP, WSS - Blog about Design, MC

# re: Crack Open a List Template STP to Retain Lookup Column Data 11/12/2005 1:54 PM Mark Kruger, SharePoint MVP

Very Nice Tip Todd! Thanks!

# SharePoint Web Parts: Free 3rd Party SharePoint Web Parts &amp; Tools 11/25/2006 11:13 AM The Boiler Room - Mark Kruger, SharePoint MVP

For those who aggregate my feed and do not often visit the blog iteself... I've updated my SharePoint...

# re: Crack Open a List Template STP to Retain Lookup Column Data 1/26/2007 12:07 AM Kelvin Wong

Hi Todd,

Thanks for this explanation, but how do "normal" users do this without have to resort to VB.NET (not programmer) and looking at XML files?

# re: Crack Open a List Template STP to Retain Lookup Column Data 2/1/2007 10:14 PM Todd Bleeker

Of course, the STP file can always be created manually.

<Todd />

# re: Crack Open a List Template STP to Retain Lookup Column Data 6/18/2007 6:28 AM wotssp

hello

# Free SharePoint Web Parts (3rd Party) 6/26/2007 10:15 AM The Boiler Room - Mark Kruger, Microsoft SharePoin

Free SharePoint Web Parts (3rd Party) Konrad Brunner - UGS&#39;s Web Parts (broken link 8/25) Document

# re: Crack Open a List Template STP to Retain Lookup Column Data 8/14/2007 8:30 PM E:mail tracker 7.0

need a crack for E:mailtracker 7.0

# Alternate Method 12/12/2007 1:06 PM Michael A. Vickers

I've published an alternate method for relinking your lists after you've deployed your lists to a production server. It involves tweaking records in the content database.

I know that editing information in the content database through query analyzer is generally considered a no-no, but if you're confident in your SQL abilities and have already deployed your lists to production, give it a shot.

<a href="Deploying">http://idiotsyncrasies.com/2007/12/deploying-linked-lists-in-moss-2007.aspx">Deploying Linked Lists in Moss 2007</a>

# re: Crack Open a List Template STP to Retain Lookup Column Data 12/12/2007 1:07 PM Michael A. Vickers

Whoops, I screwed up the url:

http://idiotsyncrasies.com/2007/12/deploying-linked-lists-in-moss-2007.aspx

# re: Crack Open a List Template STP to Retain Lookup Column Data 3/4/2008 8:50 AM Miguel A. Albero

Excellent solution. I have been scratching my head for a while today, finally I found this and you solved my problem, thumbs up and much gratitude!

# List - Template - colonne Lookup | hilpers 5/6/2009 7:03 AM Pingback/TrackBack

List - Template - colonne Lookup | hilpers


Comments on this post are closed.
Title  
Name  
Url
CAPTCHA
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments