3

I want to download/export all .wsp solution files from SharePoint 2007 farm in order to deploy them again on new environment. How can i export or download .wsp files? I don't want to extract .wsp files. I just want the copies of all .wsp files. How its possible?

3

Here is a generic idea

  1. Using stsadm -o enumsolutions get all installed solutions on the farm
  2. Then for each solution you need to download it using following technique

    [System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Cult ure=neutral, PublicKeyToken=71e9bce111e9429c")

    [System.Reflection.Assembly]::Load("Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")

After this you can extract the files from the configuration database:

$farm = [microsoft.sharepoint.administration.spfarm]::Local

$wsp = $farm.Solutions.Item("solutionname.wsp").SolutionFile

$wsp.SaveAs("c:\solutionname.wsp")

http://spsolution.wordpress.com/2012/11/07/extract-wsp-file-from-configuration-database/

4

If you get an error adding SharePoint DLL which states

Could not load file or assembly 'microsoft.sharepoint, Version=12.0.0.0

you can try using this script instead

[Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

and you can continue exporting the WSP from your 2007 environment

$farm = [microsoft.sharepoint.administration.spfarm]::Local
$wsp = $farm.Solutions.Item("documentmanagement.actions.wsp").SolutionFile
$wsp.SaveAs("c:\temp\documentmanagement.actions.wsp")

Reference: Running PowerShell on MOSS 2007

1

I realize that this post is quite old, however I just ran into this issue myself during a 2007 migration project. In my case, there were quite a few solutions and downloading each one manually wasn't exactly ideal for me. I created a folder "solutions" on the C: drive and modified the above script to download all solutions into that folder.

[Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$farm = [microsoft.sharepoint.administration.spfarm]::Local
$solutions = $farm.Solutions
ForEach ($solution in $solutions) {
    $wsp = $farm.Solutions.Item($solution.Name).SolutionFile
    $file = "C:\solutions\" + $solution.Name
    $wsp.SaveAs($file)
}

Hope this helps someone out there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.