In my Scenario, I have 2 WSP files:
- NewSolutionPack.wsp (to add it as first time)
- UpdateSolutionPack.wsp (to update an exist WSP file)
- Target web application (http://sps:1)
The steps of deployment are easy:
1. Add solution to Farm Solutions
2. Deploy your solution to a specific web application or to all web applications
3. In case of exists solution, you will upgrade the solution using one of the following options:
a. Retract and delete the old solution, then add and deploy the new one
b. Or, upgrade the existing solution using upgrade method (recommended).
Steps of deployment using STSADM
1. Add solution to Farm Solutions
a. Open cmd (Star > Run > write cmd in box > click ok)
b. Mont the folder that contain stsadm execution file (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN)
c. Enter the following script2. Deploy your solution
stsadm -o addsolution -filename “C:\WSP Deployment\NewSolutionPack.wsp”
a. To a specific web application
stsadm -o deploysolution -name “NewSolutionPack.wsp” -url “http://sps:1″ -allowgacdeployment -immediate –allowcaspolicies
Check it from Central Administration > System Settings > Manage Farm Solutions
b. To all web applications3. Upgrade the solution by Retract and delete the old solution, then add and deploy the new one
stsadm -o deploysolution -name “NewSolutionPack.wsp” -allcontenturls -allowgacdeployment -immediate –allowcaspolicies
a. stsadm -o retractsolution -name “NewSolutionPack.wsp” -url “http://sps:1″ –immediate
if you want to retract the solution from all web applications, you need to use this
stsadm -o retractsolution -name “NewSolutionPack.wsp” -allcontenturls –immediate
b. stsadm -o deletesolution -name “NewSolutionPack.wsp”
c. stsadm -o addsolution -filename “C:\WSP Deployment\NewSolutionPack.wsp”
d. stsadm -o deploysolution -name “NewSolutionPack.wsp” -allcontenturls -allowgacdeployment -immediate –allowcaspolicies4. Upgrade the solution by using upgrade method
a. Enter upgrade script
stsadm -o upgradesolution -name “NewSolutionPack.wsp” -filename “C:\WSP Deployment\UpdateSolutionPack.wsp” -allowgacdeployment -immediate –allowcaspolicies
Steps of deployment using PowerShell
1. Add solution to Farm Solutions
a. Open PowerShell (SharePoint 2010 Management Shell)
b. Enter the following script:2. Deploy your solution
Add-SPSolution “C:\WSP Deployment\NewSolutionPack.wsp”
a. To a specific web application
Install-SPSolution -Identity “NewSolutionPack.wsp” -WebApplication “http://sps:1″ -GACDeployment -CASPolicies -Confirm:$false
b. To all web applications3. Upgrade the solution by Retract and delete the old solution, then add and deploy the new one
Install-SPSolution -Identity “NewSolutionPack.wsp” -AllWebApplications -GACDeployment -CASPolicies -Confirm:$false
a. Uninstall-SPSolution -Identity “NewSolutionPack.wsp” -WebApplication “http://sps:1″ -Confirm:$false
if you want to retract the solution from all web applications, you need to use this
Uninstall-SPSolution -Identity “NewSolutionPack.wsp” -AllWebApplications -Confirm:$false
b. Remove-SPSolution -Identity “NewSolutionPack.wsp” -Confirm:$false
c. Add-SPSolution “C:\WSP Deployment\NewSolutionPack.wsp”
d. Install-SPSolution -Identity “NewSolutionPack.wsp” -WebApplication “http://sps:1″ -GACDeployment -CASPolicies -Confirm:$false4. Upgrade the solution by using upgrade method:
Update-SPSolution -Identity “NewSolutionPack.wsp” -LiteralPath “C:\WSP Deployment\NewSolutionPack.wsp” -GacDeployment -CASPolicies -Confirm:$falseFor more information about mapping from stsadm to PowerShell, read the full MSDN topic: Stsadm to Windows PowerShell mapping (SharePoint Foundation 2010)
I Hope this useful for you,
Thanks.
No comments:
Post a Comment