Read time 4 minutes

Summary: Windows Solution Package combines multiple features into a single file that allows direct deployment to the SharePoint Server. You can take back up of a WSP file with PowerShell Management. This article will guide you how to back up a WSP in a Sharepoint Server with PowerShell. It will also introduce you with Kernel Migration for Sharepoint which supports migrating metadata, user permissions, and a lot more.

 

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 has components such as list instance and list definition. These elements can be organized into a distinct feature and stored within a Windows SharePoint Solution Package (WSP) for easy management.

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

Solution Explorer

Solution Explorer empowers users to navigate and manage SharePoint project files easily. Within its context menu, there are unique functionalities for adding Features, Feature Resources, and Feature event receivers. Additionally, users can access multiple features and package designers for creating, deploying, and overseeing 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 the following-

  • Open SharePoint projects and files.
  • Drag & drop SharePoint files, projects, and files into the same package.
  • Drag & drop SharePoint files, projects, and files from one package to another.
  • Add a distinct feature in the package.
  • Open the package.
  • Validate the 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 defines the feature’s range, either to a specific site or a site collection. If the feature is enabled for a particular site, it operates exclusively on that site. Conversely, if activated at the site collection level, the feature functions across all sites within the collection.
  • If a feature relies on other features, the tool aids in activating a feature dependency to indicate the dependent feature. This facilitates the identification of features before making them accessible within the packages. The feature dependency activation ensures whether 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 from copying the package file to the SharePoint Server, the Package Designer helps you decide when to restart the IIS Server back again.

Utilizing these tools, you can generate WSP files and utilize them as needed. These packages encompass comprehensive details regarding features and functionalities, potentially including site services, definitions, and tailored features. Once created, the WSP files can be downloaded and subsequently reused on a distinct SharePoint account. If you possess a backup of the SharePoint account data, you’re enabled to proceed with preserving the WSP file.

Back up a WSP file in a SharePoint Server
  1. Login to the 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 on the Solution Management of Central Administration page.

Back up using WSP SharePoint Extractor PowerShell script

WSP Extractor uses a PowerShell script for SharePoint (on-premises) to create a version history, providing comprehensive logs of all the SharePoint packages (WSP) deployed at your end. With WSP SharePoint Extractor, it is easy to export and take a backup of your WSP SharePoint. WSP SharePoint Extractor supports SharePoint 2019, 2016, 2013, and 2010.

Follow the given steps to back up your data using the PowerShell script.

    1. Log in to the SharePoint server with the farm admin account
    2. Open PowerShell as Administrator.

       

      select Always use this profile

    3. Execute the given cmdlet in the PowerShell to install WSP SharePoint Extractor.
      Install-Script -Name Backup-WSPSharePoint

       

      select Always use this profile

Note:Use PowerShell 5.0 or later versions to run these scripts.

  1. After installing, run the below cmdlet.

    Backup-WSPSharePoint

  2. Enter Y to confirm the backup.
  3. The script starts making a0020version hierarchy to store the WSP SharePoint solutions.
  4. As the script finishes execution, it will automatically open the root folder.

These few steps will allow you to back up a WSP in a SharePoint Server using the PowerShell scripting. However, it is important to ensure that you do not miss any steps and perform these scripts with utmost prudence.

Conclusion

SharePoint administrators have several essential tasks to handle, such as data backup and migration. If you require assistance in backing up or migrating content to SharePoint from a different platform, you can seek professional aid from Kernel Migration for SharePoint. The has all the necessary capabilities to seamlessly migrate content, including metadata, permissions, and various properties. It is a comprehensive tool for both SharePoint migration and back up.

Q- What is a WSP file?

A- A WSP file or Windows Solution Package in a SharePoint environment is a compressed file that consolidates features, site templates, assemblies, and several other components.

Q- Is it possible to make modifications to the content of a WSP file?

A- Once you extract the WSP files (solution components), you can make modifications to site templates, assemblies, configuration files, and others as you need.

Q- What to consider while you backup a WSP file in a SharePoint server?

A- When you perform a WSP backup, it’s important to verify that you have all the necessary permissions assigned to execute backups and have enough disk space to store the backup files.

Q- What to do if I encounter errors during back up of .wsp files?

A- If due to any reason, you encounter any errors during the backup process of a .wsp file, try troubleshooting them by analyse the message displaying error in detail. Checking system logs and verifying that you’ve met all the requirements is also a notable step. However, if you still are unable to do that migrate to SharPoint using Kernel Migration for SharePoint, an efficient tool that performs SharePoint migration.

Q- How do I verify if the backup was completed?

A- Once you run the PowerShell script to perform a backup, you’ll see the progress and completion summary mentioned in the end. You can also check the success of the backup process at the location mentioned in the Directory parameter. This will show you the WSP files backed up successfully at the given destination.

Kernel Migration for SharePoint