1

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.

5
  • 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 Apr 12, 2014 at 6:55
  • Are there any negative effects on the list data or anything, is it good practice?
    – variable
    Apr 12, 2014 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, 2014 at 8:01
  • Good practice would be to not have so differing functionality in the same feature. Apr 12, 2014 at 8:36
  • But the behavior with the newform sounds strange! Apr 12, 2014 at 9:03

1 Answer 1

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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