views:

71

answers:

1

Assume you deploy a Sharepoint solution, which consists of multiple WebParts and multiple Lists. Now in a later version of this solution, you want to extend/modify these lists, like add or remove columns.

How do you deploy such changes to a production environment? Meaning, how do you apply these changes to a production environment where these lists contain production data?

Update This also includes changes to the Views of the lists.

+1  A: 

In my deployment we have a "SolutionName_UpdateFields" feature. We implement adding/deleting fields etc jobs in the FeatureActivated event receiver of this feature. The code in this class is written so that it can be called many times, but it will attempt to perform the changes only once (if we're adding a field, first check if the field is not already there etc).

Then we ask the admins to stsadm -o deactivatefeature and then stsadm -o activatefeature again, hence forcing the code to be executed.

naivists
Thanks, I thought of something similiar. But what do you do, if you need to update the views of a list as well? DO you use the Sharepoint OM there as well?
driAn
These are also put into the same feature.
naivists
Hmm ok, but do you upgrade the Views by updating the "query" property of the SPViews or do you make use of the migration API somehow?
driAn
If the list has not been customized after deployment (e.g. no fields are added manually or fields added to content types), we update the `schema.xml` of the list, whenever possible. If this is the case, I have also sometimes used `oList.Views["SomeView"].ViewFields.Add(someList.Fields["SomeField"])`. No, I have never used the migration API.
naivists