Creating Sitecore Packages

Today I am going to explain the process of creating packages in Sitecore.


Sitecore packages are used for different tasks like when you need to copy items from one Sitecore instance to another instance or you want to create a backup for some files or you want to perform mass data migration then packages help you a lot. It helps in lowering the development cost & time and also increases the reliability.


Sitecore packages are usually used for small Projects. But for larger projects, Team Development for Sitecore (TDS) is used. But why?


Here is the answer -

Suppose you created a package for some of the items and later you changed these items, then you have to create the package again to update or modify these changes in your backup files. While if you make item changes in TDS then it will auto Sync these changes. Hence TDS is preferred over Sitecore packages.

Now I am going to tell you how to create packages in Sitecore -
 

Creating a package in Sitecore

  • Go to 'Sitecore Launchpad/Desktop/Development Tools/Package Designer'.
  • A window will open by name of Package Designer.
  • In package designing you can add items statically, files statically, items dynamically, files dynamically, and can add security accounts as well.
  • Firstly I am explaining what all these methods are - 
    1. Items statically - It is used when you know the exact items from the content tree that you want to add to the package.
    2. Files statically - It is used when you know the exact files from Sitecore Instance that you want to add to the package.
    3. Items dynamically - It is used when you don't know the exact items that you want to add but you know criteria and based on that criteria you can filter items from the content tree to add in a package.
    4. Files dynamically - It is used when you don't know the exact files that you want to add but you know criteria and based on that criteria you can filter files from Sitecore Instance to add in a package.
    5. Security accounts - It is used to add users and roles from Sitecore into the package.
  • So let's add items and files statically. To add items statically select 'Items statically' from the toolbar. Select the database as master. Select the items which you want in your package. You can select the subitems along with the item by clicking 'Add with Subitems' or if you want a single item then you can click 'Add Item'. When you have selected all the items that you want in the package then click 'Next'. Give a suitable Source name and then click 'Next'.
  • Similarly, you can add files statically. Adding files statically will open the Sitecore Instance files and you can select the file that you want to add to the package by clicking 'Add path'.
  • Now let's add items and files dynamically. To add items dynamically select 'Items dynamically' from the toolbar. Select the database as master. Now select the root item from which you want to add items. Now select the filters and on basis of the data you entered in the filter, it will automatically select items. Then click 'Next'. Give a suitable Source name and then click 'Next'.
  • There are 8 filters - 
    1. Item name filter - It is used to select the items which contain the name that you have entered in the name filter.
    2. Creation date filter - It is used to select items based on the date of creation of the item.
    3. Modification date filter - It is used to select items based on the last modification date.
    4. Publish date filter - It is used to select items based on the date on which item is published.
    5. Template filter - It is used to select items that are based on selected templates.
    6. Created by filter - It is used to select items that are created by selected users.
    7. Updated by filter - It is used to select items that are modified by selected users.
    8. Language filter - It is used to select items based on the language.
  • Similarly, you can add files dynamically. Adding files dynamically will open the Sitecore Instance files. Then you need to select the root folder and then you can select files by applying filters.
  • You can also add Security accounts. To add users and roles select 'Security accounts' from the toolbar. After that click 'Add' and you can see the roles and users. Select the roles and users you want to add to the package and click 'Ok'.
  • At the left corner, you can see Sources which contains all the sources that you have created for the package.
  • Now in metadata give the package name. The package name is mandatory while others are optional.
  • Now you can save this package or you can download it.
  • To download the package click on 'Generate zip'. Provide a package name and click on 'Next'. You can now download the package by clicking on the '' button. If you click on 'Close' without downloading and want to see the package then you can navigate to the path 'SitecoreInstance.dev.local/App_Data/packages' and you could see the package zip file.
References


Chirag Goel

I am a developer, likes to work on different future technologies.

Post a Comment (0)
Previous Post Next Post