How to Backup a WSP in a SharePoint Server Using PowerShell ?

Aftab Alam
Aftab Alam | Published On - 19 Jan 2021 |

Read time 4 min

SharePoint has many useful features in its environment that are highly important for storing data, optimizing its usage, and accessing it in minimum time. One such important feature is SharePoint Solutions that are packaged through a solution package (WSP). Such solutions packages can be created through Visual Studio for a better SharePoint organization and creation and deployment of such packages.

What is a Solution Package?

A solution package combines multiple SharePoint features into a single file and lets you deploy directly to SharePoint Server.

For example, A contact list can contain some elements like list instance and list definition. You can create a separate feature having these elements and save them in a SharePoint Server package (WSP).

There are several SharePoint tools to manage and deploy the packages-

  • Solution Explorer.
  • Packaging Explorer (the tool window).
  • Feature Designer and Package Designer.

Solution Explorer

The Solution Explorer allows the user to navigate and handle the SharePoint project files. The context menu of solution explorer has special features to add Features, Feature Resources, and Feature event receivers. The user can also open several feature designers and package designers to create, deploy, and manage the packages.

Packaging Explorer

The Packaging Explorer is a window tool that collects the SharePoint files into packages. There is a simple hierarchical view of the complete package, project items, features, and files. The essential tasks in the packaging explorer are following-

  • Open SharePoint projects and files.
  • Drag & drop SharePoint files, projects, files into the same package.
  • Drag & drop SharePoint files, projects, files from one package to another.
  • Add the distinct feature in the package.
  • Open the package.
  • Validate package and its features.

Feature Designer and Package Designer

  • With the help of a feature designer, the user can create features, manage scope, and declare the dependencies in the features. The designer part of the tool shows the final XML file that notifies the description of the feature.
  • The feature designer sets the scope of the feature to an individual site or a site of collection. When the feature is activated for the single site, then it will work for the single site only. But, when the feature is activated in the site collection, the feature will work on all the sites.
  • When one feature is dependent on other features, then the tool helps you in activating a feature activation dependency to mention the dependent feature. It helps in identifying the feature before making them available for the packages. The feature activation dependency assures that if the feature is already activated or not.
  • With the help of the package designer, the user can group the SharePoint elements in the single WSP package and reset the Web server for deployment.
  • During the deployment, if the IIS server is stopped to copy the package file to the SharePoint Server, the Package Designer helps you in deciding when to restart the IIS Server back again.

With the help of all these tools, you can create the WSP files and use them accordingly. These packages will have complete information on the features and the functionality. It can also contain site services, definitions, and other custom features. You can also download the WSP files and can reuse them again to a different SharePoint account. If you have the backup of the SharePoint account data, then you can go ahead in saving the WSP file.

Backup a WSP file in a SharePoint Server

  1. Login to SharePoint Server and open the SharePoint PowerShell Management tool as the Administrator.
  2. Input the below script-
    $farm = Get-SPFarm
    $file = $farm.Solutions.Item(“SolutionPackage.wsp”).SolutionFile
    $file.SaveAs(“c:\fullpath\SolutionPackage.wsp”)

    NOTE
    You can get the complete path of the Solution package at the Solution Management of Central Administration page.

Conclusion

Apart from WSP backup, there are many tasks SharePoint administrators need to perform, like data backup, migration, etc. When you want to backup content or migrate content to SharePoint from another platform, you can take the professional assistance of Kernel Migrator for SharePoint. The software has all the features to migrate the complete content, their metadata, permissions, and other properties. This is a complete tool for SharePoint migrations and backups.