Monday, June 15, 2009

Why use "dynamic" sources in the packager?

Here's a little bit of advice that many people may not be aware of:
  • Use dynamic sources whenever possible when you create Sitecore packages.
If you're like me, your first instinct is to use static sources ("add items statically..." or "add files statically..."). That's because it seems easier to choose which items or files to add. It turns out, however, that dynamic sources, while a little harder to create, offer one great advantage; when you create a new package "From Existing...", the package new package will "re-run" the dynamic query to choose items. To understand the difference, consider this case:
  1. You create a package with all items under the "Home" item in the package.
  2. Install the package on a clean site.
  3. Delete most of the items and create a bunch of new items under Home.
  4. Create a new package "From Existing..." (an option in the New drop down menu).
    • If, in step 1 you used "static" sources, the new package will NOT include the new items under Home.
    • If, in step 1 you used "dynamic" sources, the new package will include the new items under Home.
Thus, using dynamic sources allows you to recreate a new package when you've made lots of changes very easily, where as you almost need to start from scratch with static sources. Hope this helps a few people out there!

6 comments:

Mark said...

Is that the only difference between dynamic vs static? I've found it hard to find documentation on the difference and when to use one vs the other.

Anonymous said...

I have about 300,000 items I'd like to ignore. It'd be easy to exclude them with one template, but I don't have that option. Even when I include ALL the other templates, it takes forever to create the package (forever = not usable). Any suggestions?

Anonymous said...

The reason it takes forever is because you're not suppose to create packages over 50MB in Sitecore for performance reasons.

sri vidya said...

This is the nice article on
sitecore please keep Sharing
For more updates Click here

Unknown said...

Thanks for giving this information.
SAP Basis Training in Chennai

Anonymous said...

What is the main difference between static packages and dynamic packages
Learn Programming Languages