Thursday 5 March 2015

How to retrieve lost WSP package to prepare the SharePoint migration

Hi All,

In order to prepare the migration of our SharePoint 2010 Farm to SharePoint 2013 Farm, I discover that old wsp packages were still present on the content databases.

Some of them are “relics” from SharePoint 2007 …


Of course, it is not possible to find where those wsp files are stored, and the old SharePoint 2007 servers are removed from the network since several years…


First, I started to enumerate the deployed solutions via PowerShell:

Cmdlet used:
Get-SPSolution | ? { $_.Deployed } | % { $_.DisplayName}

As output, I had this list:

mycompany.customertemplate.wsp
mycompany.mysite.branding.wsp
mycompany.po.projectsitedefinition.v1.2.0.wsp
ev_sharepointwebpartscab.cab
extendeddiagnosticproviders.wsp
sharepointsocialnetworking.wsp


Then, I’ve executed the next code to iterate the solutions collection and to retrieve all missing .wsp, using my previous list:

Add-PSSnapin Microsoft.SharePoint.PowerShell

$farm = Get-SPFarm
$file = $farm.Solutions.Item("<YourSolutionFile>.wsp").SolutionFile
$file.SaveAs("D:\temp\<YourSolutionFile>.wsp")


i.e:
$farm = Get-SPFarm
$file = $farm.Solutions.Item("mycompany.customertemplate.wsp").SolutionFile
$file.SaveAs("D:\temp\mycompany.customertemplate.wsp")


Now, I can yuse those .wsp, in my SharePoint 2010 test-farm.
I'll then prepare the databases by cleaning them from the old useless solutions.




That’s all Folks,



Marc



***** Disclaimer *****
http://www.belgacom.be/maildisclaimer

No comments:

Post a Comment