Introduction
This posting consolidates notes and references associated with updating a custom solution in a customer environment. In this instance, the updated solution involved a farm solution having web scope and deployed to a specific web application. Not all possible steps are included here, but only those engaged in the particular instance.
The general procedure involved the following key steps:
- De-activate solution features
- Retract the solution
- Remove the solution
- Install the new solution
- Deploy the new solution
Each of the steps that were performed will be discussed here.
Procedure
Deactivate Solution Features
- Engaged the developer to identify the solution package that needs to be updated. This will end in ".WSP". Let's call it MySolution.wsp. Also engaged the developer to identify the scope of the features introduced by the solution and what web application, site collection and/or web that solution features are activated in. In this case, the solution introduced a single feature, call it MySolutionFeature.
- Navigated to C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\
FEATURES\, and verified that only one feature is listed that is associated with the solution. - Opened the feature folder, MySolutionFeature.
- Opened Features.xml and verified the feature scope.
- On a farm SharePoint server, opened an elevated SharePoint Management Shell (SMS), and then executed the following:
$packageName = "MySolution.wsp" $solId = (Get-SPSolution $packageName).Id Get-SPFeature | where {$_.solutionId -eq $solId}|select DisplayName, Scope
- Navigated to the web's Manage Features page and deactivate the feature. This task was performed by the developer who new the web where the feature had been activated. This could also have been automated via PowerShell. See Disable-SPFeature for details.
- Verified with the developer that the solution did not add any artifacts to the content database (e.g., .WebPart files in the Web Part Gallery) when it was installed.
Retract the Solution
- Launched Central Administration and navigated to: System Settings > Manage farm solutions. This displayed the Solution Management page.
- Clicked on MySolution.wsp. This displayed the Solution Properties page. Noted and verified all data displayed.
- Clicked on Retract Solution.
- Selected the web application to retract the solution from, leaving the other fields default, and clicked OK.
- Refreshed the Solution Management page until the status of the solution indicated Not Deployed.
- On the Solution Management page, clicked MySolution.wsp. This showed the Solution Properties page.
- Verified the last operation completed successfully and that the solution was removed from each farm server hosting the web application to which the solution was deployed. This includes removal of associated feature folders.
- Navigated to C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\
FEATURES\, and verified that the feature folder, MySolutionFeature, was removed.
Remove the Solution
- On the Solution Management page, clicked MySolution.wsp. This showed the Solution Properties page, this time showing the Remove Solution function for MySolution.wsp.
- Clicked Remove Solution.
- Clicked OK at the prompt.
- On the Solution Management page, verified that the solution no longer appears listed.
- In an elevated SMS, executed Get-SPSolution and verified that the solution no longer appears listed.
Install the New Solution
- Identified a folder in which to place MySolution.wsp.
- On a farm SharePoint server, opened an elevated SharePoint Management Shell (SMS), and then executed the following:
Add-SPSolution -LiteralPath "[PathToFolder]\MySolution.wsp"
- Navigated to the Solution Management page, and then verified that the solution, MySolution.wsp, was listed there with status Not Deployed and deployed to None.
- Clicked on MySolution.wsp and verified that the Deployment Status was Not Deployed.
Deploy the New Solution
- On the Solution Management page, clicked on MySolution.wsp and viewed the Deploy Solution page.
- On the Deploy Solution page, clicked Deploy Solution.
- On the Deploy Solution page, selected the target web application, and then clicked OK.
- On the Solution Management page, refreshed the page occasionally, until the status of the solution becomes Deployed.
- Clicked on the solution to the view the Solution Properties page.
- Verified that the last operation result states The solution was successfully deployed.
References
- TechNet
- General
- Activating and Deactivating Features with PowerShell in SharePoint 2010
- SharePoint: Don’t Forget to Uninstall the Feature: written for 2007, but excellent discussion still useful for 2013.
- Uninstallation and Retraction of a Farm Solution: written for 2010 but still applicable to 2013.
- SharePoint 2013: The 15 Hive and other important directories
- How to remove safe a feature in SharePoint 2013?
- Get features list from wsp solution: written for 2010 but still applicable to 2013. Great posting.
- PowerShell to List Activated Features for a Site and Web
- PowerShell: Script to check feature status (enabled/disabled) before activating
No comments:
Post a Comment