Help, I lost my WSP files for my SharePoint 2010 farm!

Scott ZischerkWhen working on a client site, sometimes I need to bring their site back to my office to replicate their environment on a server that I can play around with.  When doing this I take my usual backup-spsite or SQL backup, but in order for the site to function properly I also need all of the solutions that were installed.  More times than not, the client does not know where all of the wsp files are.  So what can you do?

PowerShell to the rescue!  I simply extract the wsp’s from the SharePoint Central Administration server using the following commands:

$directory = "C:\WSP\"
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local;
$solutions = $farm.Solutions; 
$solutions | ForEach-Object { $_.SolutionFile.SaveAs($directory + $ };

Note:  Make sure the c:\WSP directory exists before running the commands.

That’s it.  After running the commands you should have all the wsp files that were installed on the farm in the c:\WSP directory.

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s