Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper stsadm commands to update SharePoint Solution/Feature

What are the proper stsadm commands in sequence to force an upgrade to a SharePoint solution. I have tried

C:>"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o deploysolution -name "MySolution.wsp" -immediate -allcontenturls -allowGacDeployment -allowCasPolicies -force

followed by

C:>"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o execadmsvcjobs

It seems to deploy and shows the solution as having a deployment time of when I push these commands but my files don't appear to get updated and new files don't appear.

Am I missing something? Do I need to do an IISReset /noforce after processing these commands.

Thanks, Josh Lewis

like image 304
Omenof Avatar asked Apr 14 '09 15:04

Omenof


3 Answers

The proper way is to use the -o upgradesolution command. In most cases there is no need to retract and delete the solution and reinstall it. Be sure and follow it up with an -o execadmsvcjobs as usual.

like image 107
Corey Roth Avatar answered Sep 22 '22 14:09

Corey Roth


stsadm -o retractsolution -name ... -immediate -allcontenturls
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name ...
stsadm -o addsolution -filename ... 
stsadm -o deploysolution -name ... -immediate -allcontenturls -allowgacdeployment -allowcaspolicies
stsadm -o execadmsvcjobs

A few warnings:

Sometimes you have to start with deactivating the feature first (stsadm -o deactivatefeature). When I changed a Site feature containing a list template to a Web feature I ended up with double links on the create page. So i had to install the old feature again, deactivate it and then reinstall the new feature.

Do NOT use -force if you're not sure what you are doing. If you use it with the -o deletesolution command you may end up with old versions of files on some or all of your servers. Such problems can be hard to track down and it gives you a lot of extra work, especially if you have multiple front end servers.

like image 34
JMD Avatar answered Sep 21 '22 14:09

JMD


  1. Ghosted files don't get updated.

  2. stsadm -o execadmsvcjobs will proces any job, that is late on processing

  3. reactivate features, Those that contain content (next time; use feature stapling!)

  4. upgrading solutions will not always automatically install new features (yes, install, not activate). Check this.

like image 35
Hans Avatar answered Sep 22 '22 14:09

Hans