There are certain scenarios where we have to deploy the sandbox solution again with new functionality (like new column in list). Since existing solution already stores crucial data, then retracting the previous version of solution will result in losing of existing data.
- Make changes in your list like add new column and save it.
- Open feature which is linked with list.
- Click on “Manifest” option. Expand Edit options.
- Replace with the below content, change ListName with you list Name and save it. Here I am upgrading the list in which I have added one more column.
<?xml version=”1.0″ encoding=”utf-8″ ?>
<VersionRange BeginVersion=”0.0.0.0″ EndVersion=”22.214.171.124″>
<ElementManifest Location=”ListName\Elements.xml” />
- Now open properties of same feature (press F4 when you are at feature window). There you will find Version property. Currently it is blank and you have put there any version which lies within 0.0.0.0 to 126.96.36.199
- Let say I am putting 188.8.131.52 and save it.
- Publish the solution and create wsp package.
- Rename the wsp package because existing solution with same name is already present.
- Now open Sharepoint management shell with admin account.
- Execute below powershell commands to add and upgrade the new solution
- Add-SPUserSolution -Site <sitecollectionURL> -LiteralPath <full path of sandbox solution wsp>
- Update-SPUserSolution -Identity <existingSolutionName> -Site $workspaceUrl -ToSolution <newSolutionName>
- Go to list settings and you will find new column.
Note : Follow above steps in case you have to update content type. Changes will be done at step 4 where you have to use AddContentTypeField instead of ApplyElementManifests
For more details, please follow read below articles: