Wednesday, March 10, 2010

Things to consider when using Sitecore Packager


It is going to be a quick one. There is a simple checklist of things that you can use to help Packager be your friend.

1. Don’t include stuff you don’t need to. I see people including the whole folder with system templates instead of adding only custom templates or just changed fields on the system templates if there are any.

2. Use PChex component to verify package integrity.

3. Prefer dynamic sources over static sources. Kerry describes why here.

4. Disable search index to improve performance of package installation.

5. Get yourself familiar with the Installation Options. Use “Overwrite” very, very carefully as it may overwrite the branches.

6. Predefine those installation options. If somebody else is going to install your package, you don’t want them to choose for you.

7. Though readme gets ignored in most cases, do your best to supply the installation information or post-install directions with the package metadata.

8. Make sure to save the package project (xml file).

I realize that this may not be a complete list, so please feel free to share your experience and do comment.

Thanks!

6 comments:

Eli Thompson said...

Don't forget to include any new templates along with new items in a package.

Another thing to watch out for is that it's possible to add items statically that are further down a branch in the tree than exist on your target. For example, you have nodes A -> B -> C on the system you're creating the package from. You choose (statically) node C (only) to be included in the package. If you then go to a system where only node A exists and run that package, the package will create the B and C nodes, however, node B will be the default template type ("Node").

Unknown said...

Great addition, thanks Eli!

Eli Thompson said...

Anti-pattern: run a package on a database, then re-create the package from that database.

Here's a problem that can happen when you do that: if you include an item twice in the package, when the package is run, Sitecore will create the two versions of that item. You won't really notice that.

So then, if you re-create the package from the database you just ran it on, you will pick up both versions of the item twice (because it's in the package twice and you have two versions on it.)

So, the more times you do this, the more versions on that item you'll get. N^2. I ended up with 1024 versions of a few items that way. It's hard to spot at first, but I soon realized my package size was ballooning and it took longer and longer to run the package.

TimWard said...

Great information! One more thing is try not to package up content that is in your app_data directory as this can sometimes cause issues due to the fact that it refers to the local directory with a "~".

Keep your packages smaller than 50mb as when installing this package on another machine it could cause issues.

Follow the "after installation" guides provided however do NOT make the changes while the application is still installing e.g. don't edit the web.config while the application is installing.

Ivan Buzyka said...

One addition about moving "__Standard values" using packages. If you would like to create package with "__Standard Values" item you also have to add the template item (parent item of those "__Standard Values") to the package. In other case the standard values won't be picked up.
It is because there is "__Standard Values" item id added to the appropriate system field of the template.

Agadea said...

I keep running into a problem where the package can not be installed. The only error is unexpected error occurs. If I run the import a couple of times, it will finally succeed. I am using IIS 7 and WinServ2008. Any suggestions?