Retractsolution: Stsadm operation (Office SharePoint Server)

Updated: April 26, 2007

Applies To: Office SharePoint Server 2007

Updated: 2007-04-26

Operation name: Retractsolution

Retracts the specified solution’s deployment. The retractsolution operation removes files from the front-end Web server. The deletesolution operation deletes the solution package in the solution store of the configuration, and should only be called after solution packages have been retracted.

Syntax

stsadm -o retractsolution

   -name <solution name>

   [-url] <URL name>

   [-allcontenturls]

   [-time] <time to remove>

   [-immediate]

   [-local]

   [-lcid] <language>

Parameters

Parameter

Value

Required?

Description

name

A valid name of the solution in the solution store, such as “SampleSolution.wsp”

Yes

Enables the administrator to specify the name of a solution inside of the solution store.

url

A valid URL, such as http://server_name

No

URL location of a virtual server

allcontenturls

<none>

No

Equivalent to deploying the package to all nonadministrative virtual servers that are in the farm.

time

A valid date:time format that is culture-specific to the administrative language, such as “2/16/2007 12:15:12”

The -time parameter is not required if either the immediate or local parameter is specified. Otherwise, the -time parameter is required.

Enables the administrator to schedule the time that the deployment should occur.

Time requires that a user use a time format acceptable to the DateTime.Parse method. If the date time does not parse correctly, the following error message is displayed:

"‘<time user entered>’ is not a valid time format. Deployment was not initiated."

immediate

<none>

No

Causes the deployment to occur immediately after the command is executed.

local

<none>

The -local parameter is not required if either the immediate or time parameter is specified. Otherwise, the -local parameter is required.

Deploys the solution synchronously on the local computer only. The timer service is not used.

A developer must specify the -immediate, -local, or -time parameter. If one of these is not specified, the following error message is displayed:

"Deployment type was not specified. You must specify a deployment to just this server (-local), to all servers in the farm (-immediate), or a delayed deployment to all servers in the farm (-time)."

lcid

A valid locale ID, such as "1033" for English

No

Language locale ID of the solution to be retracted

Community Content Add
Annotations FAQ
Be careful when using retractsolution with -allcontenturls

Using retractsolution -allcontenturls can cause other applications to break when assemblies are mysteriously removed from their /bin folders. Thanks to The Code King for explaining why: http://www.thecodeking.co.uk/2009/11/be-afraid-retractsolution-with.html "...removes files matching the solution manifest across ALL web applications. What's not immediately obvious is that this happens regardless of whether the solution was ever deployed to the application in the first place. It's also worth noting that it performs no signature checking against assemblies targeted to the local bin directory prior to their removal. The result is that any files matching on name will be deleted from those applications even if they were not originally deployed as part of the retracted WSP, and even if they possess a different strong name. So the moral is if you're juggling multiple applications and multiple WSPs, it pays to be specific and avoid allcontenturls, in particular when targeting the bin."

immediate or local

I get an error when I don't use one or the other on a retractsolution operation. Here is what worked for me (NOTE that .wsp extension _MUST_ be lowercase - an *obvious* cheeseball Jr programmer bug):

stsadm -o retractsolution -name FunkaDelic.wsp -immediate


Very crappy help from -help on this command line tool. Please be better in 2010!