Export/Import SharePoint farm solutions using PowerShell
In My environment we lost SharePoint updated code. We want migrate SharePoint from SP 2010 to SP2013. Simply I did Export all .WSP using following Script.
Steps:
Steps:
--------
Export SharePoint 2010/2013 Farm Solutions:
1). Open SharePoint 2010/2013 Management Shell as administrator.
1). Open SharePoint 2010/2013 Management Shell as administrator.
2). Create new folder in any drive (In my case create new folder in D drive with ExportWSP name )
3). Type D: and type "cd ExportWSP"
4). Copy and run the following script.
(Get-SPFarm).Solutions | ForEach-Object{$var = (Get-Location).Path + “\” + $_.Name; $_.SolutionFile.SaveAs($var)}
5). Go back to ExportWSP Folder, Here All SharePoint wsp export from SharePoint Farm.
Import SharePoint 2010/2013 Farm Solutions:
1). Open SharePoint 2010/2013 Management Shell as administrator.
3). Type D: and type "cd ExportWSP"
4). Copy and run the following script.
Get-ChildItem | ForEach-Object{Add-SPSolution -LiteralPath $_.Fullname}
5). Go to manage Farm Solutions under System Settings(Central Admin).Here Soltuions added. go one by one to deploy using UI or Run following cmd "Install-SPSolution Sample.wsp -WebApplication "SharePointSite" -GacDeployment".
Get-ChildItem | ForEach-Object{Add-SPSolution -LiteralPath $_.Fullname}
5). Go to manage Farm Solutions under System Settings(Central Admin).Here Soltuions added. go one by one to deploy using UI or Run following cmd "Install-SPSolution Sample.wsp -WebApplication "SharePointSite" -GacDeployment".
Comments
Post a Comment