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

We have a project containing a webpart and a list instance (rootwebonly).

The webpart and the list instance are activated via a single feature.

Now problem is that, everytime a change is requested, we have to publish a new wsp, retract & remove the existing wsp. Then, add and install the new wsp and activate the feature.

Suppose there are few items in the list then, what will happen when we activate the feature? The list gets cleared off when deploying via VS! Data is lost.

Any solution to preserve data?

UPDATE

If I use PowerShell update, then, for some site collection, on the new form of the list, there is only 1 field in the new form.aspx --> Title. Other fields disappear, however, they are prevent in the list columns.

share|improve this question
    
Can't you just do an Update-SPSolution to update your webpart? It will leave your feature activated but refresh your hive and gac files –  Robert Lindgren Apr 12 at 6:55
    
Are there any negative effects on the list data or anything, is it good practice? –  variable Apr 12 at 6:58
    
If I use update, then, for some site collection, on the new form of the list, there is only 1 field in the new form.aspx --> Title. Other fields dissapear, however, they are prevent in the list columns –  variable Apr 12 at 8:01
    
Good practice would be to not have so differing functionality in the same feature. –  Robert Lindgren Apr 12 at 8:36
    
But the behavior with the newform sounds strange! –  Robert Lindgren Apr 12 at 9:03

1 Answer 1

Ideally you should leverage feature upgrade functionality. Take a look at this example: http://spblog.net/post/2011/05/02/How-to-upgrade-feature-in-SharePoint-2010.aspx

Also, a bit closer to your situation (if you use content types to provision list/library fields): http://social.msdn.microsoft.com/Forums/en-US/46114fd2-ae55-4af7-be4c-768f40af516f/update-list-definition-created-by-visual-studio-after-deployment?forum=sharepointdevelopmentprevious

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.