Creating Sitecore package using Sitecore PowerShell Extension (SPE)

If you want to move any Sitecore items from one instance to another then we currently use Packaging or Serialization as an OOTB solution. Many times we create a package of the items where it’s template or related items (media library items or rendering items) are missed and we understand it once the package is installed on another instance.

We were carrying out R&D on how can we do it efficiently and found an solution, that we can use Sitecore PowerShell Extension (SPE) for this request.

You can download the latest SPE from here. From the documentation site you can follow the installation steps.

It is rich tool that can be used to address your various requests and the documentation for the same can be found here.

Once the package is installed. You can see the Scripts option when you right click on any item.
ContentEditor_Scriptstag

Lets understand the steps on how to create the package and download it.

  1. Go to the Content Editor and navigate to the item for which you want to create a package.
    ContentEditor_testitem
  2. Right Click on the item and click on the Scripts.
    ContentEditor_testitem_Packaging
  3. Click on Packaging >> Start New Package.
  4. Select the option between – Add Item to Package or Add Tree to Package. In case you want the single item to be the packaged then go for ‘Add Item to Package’. In case you want the item with it’s child/descendants then go for ‘Add Tree to Package’.
    ContentEditor_testitem_Packaging1
  5. By default the Installation options are Merge – Merge but it better to select ‘Ask User’. In the ‘Include Linked items’ you can select the options based on your requirement. In this example I want the template and related Media item to be packaged.
    ContentEditor_testitem_Packaging2
  6. Click OK. The process will run the script.
    ContentEditor_testitem_Packaging3
  7. Once the process is completed, the pop up will disappear.
  8. Right click on the item >> Scripts >> Packaging >> Download Package.
    ContentEditor_testitem_Packaging4
  9. Fill in the details like Author, Publisher, Version, etc and click OK.
    ContentEditor_testitem_Packaging5
  10. The pop up to download the package will appear. Click on Download to download the package.
    ContentEditor_testitem_Packaging6

The package of the item with it’s related items is created successfully. Lets learn how to add the multiple items in a single package in next blog.

Thank you.. Keep Learning.. Keep Sitecoring.. 🙂

One thought on “Creating Sitecore package using Sitecore PowerShell Extension (SPE)

  1. Pingback: Creating package using Sitecore Powershell Extensions (SPE) for multiple items | Sitecore Diaries

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s