locked
How to extract a WSP-Solution from Sharepoint?

    Question

  • Hi all

    I would like to copy all sharepoint solutions from one sharepoint envrionment to another.
    How can I extract the .wsp-solution files from the source sharepoint server?

    Kind regards
    Alexander
    Monday, February 09, 2009 8:21 AM

Answers

  • I think there is no OOTB way to do that, because this files are stored in Config database and there is no way to get them from Central Admin. Nevertheless you can extract them by code:

    SPSolutionCollection solutions = SPFarm.Local.Solutions;

    foreach (SPSolution solution in solutions)
    {
        SPPersistedFile wspFile = solution.SolutionFile;
        wspFile.SaveAs("c:\\wsp\\" + solution.Name);
    }

    Blog de Barto Molina
    Microsoft MCP 6608632
    • Marked as answer by arechsteiner Monday, February 09, 2009 2:46 PM
    Monday, February 09, 2009 12:45 PM

All replies

  • I think there is no OOTB way to do that, because this files are stored in Config database and there is no way to get them from Central Admin. Nevertheless you can extract them by code:

    SPSolutionCollection solutions = SPFarm.Local.Solutions;

    foreach (SPSolution solution in solutions)
    {
        SPPersistedFile wspFile = solution.SolutionFile;
        wspFile.SaveAs("c:\\wsp\\" + solution.Name);
    }

    Blog de Barto Molina
    Microsoft MCP 6608632
    • Marked as answer by arechsteiner Monday, February 09, 2009 2:46 PM
    Monday, February 09, 2009 12:45 PM
  • Hi,

    The easiest is may be to download this tool :

    http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=37

    it allows you to download any existing solution. Then just rename your .wsp in .cab, double-click and extract manifest.xml.

    Best Regards
    Sunday, April 26, 2009 9:13 AM
  • Hi Alexander,

    If you don't want to write a custom executable to do this, take a look at the following link that shows the PowerShell required:

    http://www.sharepointbleached.com/2011/03/extract-wsp-solutions-from-sharepoint.html

    Regards

    Ben

    Sunday, March 20, 2011 6:17 PM