Export migrate all wsp solutions from your SharePoint farm

A few recent migrations I worked on required me to export and import all Farm Solutions from one SharePoint farm to another SharePoint farm. There are a few blogs and tools available to get this done.

However, I came across Shane Young’s brilliant one line PowerShell command to get the job done!

 

Export all of the Solutions from your farm:

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

 

Import all of the Solution into another farm

Get-ChildItem | ForEach-Object{Add-SPSolution -LiteralPath $_.Fullname}

Note: Shane’s blogpost has the third step to deploy all these solutions. Not all Web Applications may need to have farm solutions deployed to them. So – you might want to plan this one, rather than deploy all these solutions in one go.

 

Check out Shane’s blogpost:
http://msmvps.com/blogs/shane/archive/2011/05/05/using-powershell-to-export-all-solutions-from-your-sharepoint-2010-farm-and-other-fun.aspx

Leave a Reply

Your email address will not be published. Required fields are marked *