Packaging in Sitecore - creation and installation
This article will explain how to create a package in Sitecore and how to install it on another Sitecore instance. Or in short to move/deploy a set of changes from one instance to another Sitecore instance.
This is normally used when we would like to move changes from one instance (could be your local sitecore instance) of Sitecore to another instance (could be a shared sitecore instance running on a development server used by your team).
To deploy a set of changes, we should consider the following things:
- Sitecore item changes – all the chnags we make in the Sitecore content editor and media library.
- All the code changes we make in the sitecore .NET solution i.e., controller classes, models, view files etc which we use in renderings.
Creating package in Sitecore
- Login to Sitecore admin account in desktop mode. Open sitecore control panel and go to ‘Development tools’->’Package Designer’.
- Click on ‘Items Statically’ option at the top and then a dialogue box will appear. Select the database as ‘master’
- Select the item which you want to export and then click on either ‘Add with Subitems’ or ‘Add Item’. Continue the same for each item as you will not be able to add all the items at a time. If you would like to move entire website, then select the root item ‘Sitecore’ and select ‘Add with Subitems’.
- Click next and provide a source name, and click finish.
- Now at the top left corner, under the Sources, the new source what we have just created will be listed.
- Just below the ‘Items statically’ option, there will be another link ‘Files statically’, select that.
- Select all the solution files which you would like to move. Including .cshtml, dll file etc and click on ‘Add path’. Click next and provide Source name.
- Under the Sources, this new source will also be listed.
- Now click on ‘Generate zip’, provide a name and click on Next. If you click on finish and check the path ‘SitecoreInstanceFolder/Data/packages’ you could see the package zip file. If you cannot access the path then you can directly download the zip file from bowser instead of clicking on Finish. (There will be button next to the text ‘Click this button to download the package:’).
Installing a Sitecore package
Login to Sitecore admin panel to which you want to import a Sitecore package.
- Inside developer tools, open Installation wizard.
- Then upload the package which you want to import.
- Once the upload is completed, click next and provide package name, Version, Author, publisher etc. All these fields are optional. So you can continue even without filling these.
- Once the installation is complete, you will be asked for Restart of Sitecore Client or Sitecore Server. Select accordingly and click finish.
- Now publish the changes (either the root or the new items which you imported) to reflect. That’s it. Your sitecore package is imported now.