Thursday, June 4, 2009

Retract/Deloy solution or Upgrade solution ?

I got this question all the time about best way to upgrade the solution already deployed to the farm.

There is no simple answer to the question.As it totally depends upon artifacts and also STSADM commands have limitations.

STSADM UpgradeSolution:
Upgrading a solution involves replacing a previous version of a solution with a current version of the solution. Specifically, an upgrade occurs when a solution is deployed that shares a solution ID with another solution.

During upgrade, files that are associated with the previous version of a solution are removed, and files contained in the current version are added.You can add new files in a solution upgrade and remove old versions of the files, but you cannot install Features or use Feature event handlers to run code for Feature installation and activation.

STSADM Retract Deploy Solution:
Retracting a SharePoint solution does not remove any information from the content database. Therefore, sites are intact after redeployment.

Similarly, you must include SharePoint feature deactivation in the installation script if you want deactivation logic to execute before retracting the original SharePoint solution. You should use caution with this approach if you do not have a time when the sites that use the solution can be taken offline. If a site is based on a site definition that is being removed and reinstalled, users will experience unpredictable behavior during the upgrade process.

Common Behaviour:
You must reactivate any installed features on any sites that use the SharePoint features

MSDN , MSDN , P&P Good Example

Follow on Twitter