Extract WSP Solution files from SharePoint 2010 Farm

Before deploying updated WSP solution to SharePoint farm, administrators wish to take backup of current deployed solution in production servers just to stay on safe side. There is no option in CA to achieve this. Here is the script which gives us power to do.

(Get-SPFarm).Solutions | ForEach-Object{$var = (Get-Location).Path + "\" + $_.Name; $_.SolutionFile.SaveAs($var)}

To download single file use below script (Replace the YourSolutionFileName with actual WSP file name like abc.wsp):

$var = (Get-Location).Path + "\" + "YourSolutionFileName";(Get-SPFarm).Solutions["YourSolutionFileName"].SolutionFile.SaveAs($var)

$var = (Get-Location).Path + “\” + “YourSolutionFileName”; (Get-SPFarm).Solutions[“YourSolutionFileName”].SolutionFile.SaveAs($var)

Advertisements

About Rajan
I am Rajan Garg working as a Senior Software Engineer in a company. I am working on the Microsoft technologies.

2 Responses to Extract WSP Solution files from SharePoint 2010 Farm

  1. John Morcos says:

    Great. Thanks 🙂

  2. T.chandrasekhar says:

    1. Open the SharePoint Power Shell Module
    2. Execute $farm = Get-SPFarm
    $file = $farm.Solutions.Item(“Name of WSP.wsp”).SolutionFile
    $file.SaveAs(“C:\Backup\Name of WSP.wsp”)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: