views:

7426

answers:

5

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

+1  A: 
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.

JMD
A: 

An IISRESET might also be worthwhile but you could try to run the "SharePoint Products and Technologies Configuration Wizard", AKA PSCONFIG.EXE

Located at C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\BIN

It'll syncronize the informations that are on the Database, the IIS and the Binaries. It's necessary to run it when you apply a Service Pack.

Also make sure that all servers on your farm has access to the Central Administration and that you ran the PSCONFIG on all of them.

Felipe Barreiros
+3  A: 

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.

Corey Roth
+1  A: 
  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.

Hans
A: 

I think because you are supplying the -force parameter in the deploysolution command you are actually suppressing the error message that would probably be displayed - along the lines of Solution already exists. As stated previously either do retract->deploy or upgrade (depending on your scenario).

j.strugnell