Is it possible to build a sitecore data package fr

2019-02-03 09:18发布

问题:

The Sitecore package wizard can be used to build a package containing data and files for the local Sitecore instance.

Is it possible to build a Sitecore package (items only, files are not required) from the command line, or otherwise outside the context of a website? The idea is to use Nant to create a Sitecore data package. I'm aware of Hedgehog TDS, but this question is aimed at what can be done with the existing Sitecore api.

回答1:

You should take a look at the Sitecore.Install.PackageGenerator class in the Sitecore.Kernel to see how you may go about creating traditional Sitecore packages.

However, you are looking to do this outside of a website context. How do you plan on getting items into the package if you don't have access to the Sitecore web site in which they exist? Before you try to create a package on your CI server I would think you would need to get the Sitecore items into source control so that you can work with them.

I think you have two real options here.

  1. Roll your own solution, leveraging serialization APIs, for getting Sitecore items into source control and moving between environments
  2. Hedgehog Development's Team Development for Sitecore

For more information on Sitecore serialization please check out the Sitecore Serialization Guide. Specifically, check out how Sitecore envisions you use "Sitecore Serialization with a Source Control System"

Also, do some digging around for others who have rolled their own solution around serialization. For instance, http://mcore.wordpress.com/2009/03/17/sitecore-serialization-for-version-control/



回答2:

As skolima suggested... I've implemented and explained a solution using Sitecore Powershell Console here: http://blog.najmanowicz.com/2011/12/19/continuous-deployment-in-sitecore-with-powershell/



回答3:

The PowerShell Console for Sitecore could be possibly extended for such scenarios (or simply scripted).



回答4:

Check this link: http://www.webdatasource.com/2011/08/exporting-and-importing-packages-from-sitecore-through-code-using-sitecore-api/

It describes a solution of creating and installing Sitecore packages using the API.



回答5:

Check out Sitecore Courier Shared Source module. It compares two folders with serialized items and creates a diff package.

You can also browse the sources as an example of Sitecore.Update API usage.