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

After long search on the web i could not figure out why i have been facing wired behaviour today with my SharePoint Site.

I explain,

I have a Site Collection (Blank Site Template) which contains lists content types and site columns.

I have no specific configuration in my web app and no special configuration in my site collection.

When i tried to save Site as Template i got error telling there was a problem with a site field (which was a site colum of type LookUp).

P.s: I have a list based on a content type which is based on that site column

When i removed that site column the operation of template creation succeded, which is kind of wired.

Has anyone faced this before? Can anyone reproduce this issue? and how can i find a workaround to this issue because i need that column to be of type lookup.

Can anyone help me please?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

This is a know issue with "Save Site As Template", this operation is not full fidelity Because as you said you can do it if you add the Site colum from SharePoint (from The U.I) and not from Visual Studio...

Here, you can deduct that this issue is related to Visual Studio and What is happening behind the deployment Action...

This Problem Has many Workaround Solutions:

First, you can see the deployment order of your content types and your lists etc. in the .Package file (Design Mode), there you must find the elements in a precise order, for example the Parent SiteColumn and its related content type and list(instance and definition) must come before the child siteColumn (The One containing the lookup) to let SharePoint provison the dependent Fields in the correct order. This action is more detailed in this Post

Secondly, as in this link you need to put the OverWrite Attribute in the Elements.xml of the SiteColumn with the lookup, your Elements.xml should look like something like This

<Field
       ID="{c2f3c9d3-2433-45d5-89a2-4899dc9642f1}"
       Name="FieldName"
       DisplayName="FieldDisplayName"
       Type="Lookup"
       List="Lists/YourList"
       ShowField="FieldToLookupOn"
       Overwrite="TRUE"
       Required="FALSE"
       Group="Custom Site Columns">
  </Field>

And Finally, There is one more work around, it's about to try to BackUp then Restore the site using PowerShell Commands.

share|improve this answer

to my knowledge, creating a site template is not full fidelity! so that means you loose the lookup, alerts and workflows!

to get around this issue you need to use:

powershell:

SPBackup-site

http://technet.microsoft.com/en-us/library/ff607901(v=office.15).aspx

or stsadm

stsadm.exe -o backup

http://technet.microsoft.com/en-us/library/cc263441(v=office.12).aspx

the above only works on site collections which you have and is full fidelity, meaning all metadata and associations are kept intact!

both save files as .bak extension.

possible solution/work around here:

Possible to save a list template and maintain lookup relationships?

share|improve this answer

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.