Extract Farm Solutions from SharePoint

Seems you are directed to here from a Search Engine!

Yes you can simply use PowerShell to extract your Farm solutions a bulk. there were some .exe s also does the same but for me it was more easy to use this smart little Shell Script. Every SharePoint Guy one day will face an Migration, this little guy is a very useful and reliable one.

Run PowerShell ISE as Admin and run below Lines. use first three Lines to Extract from the source Farm and last few lines are for Destination Farm use.

   1: #Extract Solutions from Source farm 

   2: Add-PSSnapin Microsoft.SharePoint.PowerShell

   3: $farm = Get-SPFarm

   4: $farm.Solutions | ForEach-Object{$_.SolutionFile.SaveAs("c:\export\" + $_.SolutionFile.name)}</p>

   5:  

   6: #Add Solution to Another Farm 

   7: <p style="padding-left: 30px;">Add-PSSnapin Microsoft.SharePoint.PowerShell

   8: $files = Get-ChildItem "c:\install\"

   9: ForEach ($file in $files) {Add-SPSolution $file.FullName}

Sample (Change the ‘Save as’ Folder as you wish)

ps1