Upgrade and version maintenance of SharePointFeature

Source: Internet
Author: User

Upgrade and version maintenance of SharePointFeature
In this article, we will introduce the version control and upgrade of feature in SharePoint2010. Feature version control and upgrade are new features in SharePoint2010. When a feature is enabled within any range of SharePoint, the current version of the feature instance will be created. If a new later version of feature is deployed in SharePoint, SharePoint 2010 detects that the feature instance needs to be upgraded. We can use the Version attribute of the feature element to implement Version control.





FeatureVersioningandUpgrade_0_0_0_0.wsp (Feature Version 0.0.0.0 ):


FeatureVersioningandUpgrade_0_0_0_0.wsp is a sandbox solution that is deployed in the solution gallery of SharePointSite. This solution has a feature. When activated, it will add a custom column (CustomField_0_0_0_0 to the site columns ).


FeatureVersioningandUpgrade_1_0_0_0.wsp (Feature Version 1.0.0.0 ):


This will contain an upgraded feature, and CustomField_0_0_0_0 andCustomField_1_0_0_0 will be added.


Steps:
Enable Visual Studio 2010.
Click File => New => Project.
Select "Empty SharePoint Project" from the template"
Enter "FeatureVersioningandUpgrade" and click OK.
Right-click solution and click "Add new item ".
Select the "Empty Element" template and enter a name.
Click Add.




Double-click Elements. xml.
Create a text M field of the text type. See the following example:

Modify the Feature name. The entire solution is shown as follows:


Double-click feature and leave it in the Properties window. Set the version to 0.0.0.0.



Entries in Feature:


Build this solution.
Right-click solution and choose Package ".


Right-click solution and click "Open folder in Windows explorer ".


Open Bin => Debug => rename FeatureVersioningandUpgrade. wsp as FeatureVersioningandUpgrade_0_0_0_0.wsp.
Open SharePoint Site => Site Actions => Site Settings => Galleries => Solutions.
On ribbon, find the Solutions tab => New group => Upload Document.
Upload FeatureVersioningandUpgrade_0_0_0_0.wsp.
In the action list, click "Activate ".
Open Site Actions => Site Settings => Site Actions => Manage Site Features => activate "FeatureVersioningAndUpgrade Feature ".
Open Site Actions => Site Settings => Galleries => Site Columns.


Upgrade feature:

 

Next I will upgrade this feature. I want to add another custom field feature: CustomField_1_0_0_0 and change the version number from 0.0.0.0 to 1.0.0.0.

Right-click solution and click "Add new item ".
Select the "Empty Element" template and enter a name.
Click Add.
Double-click Elements. xml.
Create a text M field of the text type:


Double-click feature and set the version number to 1.0.0.0 in the property form.
Double-click Versioning and Upgrade feature. Template. xml.
Add the following settings:


Right-click solution and click "Package ".
Right-click solution and click "Open folder in Windows explorer ".
Open Bin => Debug => rename FeatureVersioningandUpgrade. wsp as FeatureVersioningandUpgrade_1_0_0_0.wsp.
Open SharePoint Site => Site Actions => Site Settings => Galleries => Solutions.
In ribbon, find the Solutions tab => New group => Upload Document.
Upload the FeatureVersioningandUpgrade_1_0_0_0.wsp.
In the operation menu, you can see a new option "Upgrade ".



Click "Upgrade ".



Open Site Actions => Site Settings => Site Actions => Manage Site Features => disable feature "FeatureVersioningAndUpgrade Feature" and then activate it.
Open Site Actions => Site Settings => Galleries => Site Columns.
You cocould see two custom columns as shown in the following.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.