sitecoresitecore6

Editing Sitecore zip package


Short question: How Can I zip unzipped package?

I am using sitecore 6.6.0 (rev. 121015) I am generating a package inside Sitecore. A zip file is generated (HomePackage.zip). When I unzip it a different zip shows up - package.zip. When I unzip package.zip I see folders with files.

The problem: When I zip uziped folders with 7z, I create package.zip file, then when I zip package.zip file I create HomePackage.zip. Notice that I haven't modified anything. Unfortunately when I try to Install newly created package (As for me it should be similar to original) sitecore throws exceptions. listed below plenty of warnings:

items/master/sitecore/content/Home/Products/Europe/Eastern Europe/Treasures of the Balkans/Summer 2015/Treasures of the Balkans/Itinerary/Day Seventeen/
ManagedPoolThread #3 10:20:48 WARN  Cannot parse reference 'items/master/sitecore/content/Home/Products/Europe/Eastern Europe/Treasures of the Balkans/Summer 2015/Treasures of the Balkans/Itinerary/Day Nine/{24348D51-7070-4B43-AD4F-E8DA902468E8}/en/1/'
Exception: System.ArgumentException
Message: Could not parse the language '1'. Note that a custom language name must be on the form: isoLanguageCode-isoRegionCode-customName. The language codes are two-letter ISO 639-1, and the regions codes are are two-letter ISO 3166. Also, customName must not exceed 8 characters in length. Valid example: en-US-East. For the full list of requirements, see: http://msdn2.microsoft.com/en-US/library/system.globalization.cultureandregioninfobuilder.cultureandregioninfobuilder.aspx
Source: Sitecore.Kernel
   at Sitecore.Globalization.Language.Parse(String name)
   at Sitecore.Install.Items.ItemReference.Parse(String reference)
   at Sitecore.Install.Items.ItemKeyUtils.GetReference(String key):

And then a final exception that stops everything:

ManagedPoolThread #3 10:20:51 INFO  Cache created: 'rules' (max size: 800KB, running total: 402MB)
ManagedPoolThread #3 10:20:51 ERROR Error installing items/master/sitecore/content/Home/Products/Europe/Independent Breaks and Mini TRIPS/World War 1 Battlefields/Summer 2015/World War 1 Battlefields/Sightseeing highlights/1 Vimy Ridge/{694AB1C9-F690-445F-9E4A-2F1BD0CC1E09}/en/
Exception: System.ArgumentException
Message: Empty strings are not allowed.
Parameter name: itemName
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ArgumentNotNullOrEmpty(String argument, String argumentName)
   at Sitecore.Data.Engines.DataCommands.AddFromTemplateCommand.Initialize(String itemName, ID templateId, Item destination, ID newId)
   at Sitecore.Data.Engines.DataEngine.GetAddFromTemplateCommand(String itemName, ID templateId, Item destination, ID newId)
   at Sitecore.Install.Items.ItemInstaller.CreateLightweightItem(ItemReference item, XmlVersionParser parser)
   at Sitecore.Install.Items.ItemInstaller.InstallItem(BehaviourOptions installOptions, Item targetItem, ItemReference item, XmlVersionParser parser)
   at Sitecore.Install.Items.ItemInstaller.GetVersionInstallMode(PackageEntry entry, ItemReference reference, XmlVersionParser parser, ItemInstallerContext context)
   at Sitecore.Install.Items.ItemInstaller.InstallEntry(PackageEntry entry)

ManagedPoolThread #3 10:20:51 ERROR Installation failed: System.ArgumentException: Empty strings are not allowed.
Parameter name: itemName
   at Sitecore.Diagnostics.Assert.ArgumentNotNullOrEmpty(String argument, String argumentName)
   at Sitecore.Data.Engines.DataCommands.AddFromTemplateCommand.Initialize(String itemName, ID templateId, Item destination, ID newId)
   at Sitecore.Data.Engines.DataEngine.GetAddFromTemplateCommand(String itemName, ID templateId, Item destination, ID newId)
   at Sitecore.Install.Items.ItemInstaller.CreateLightweightItem(ItemReference item, XmlVersionParser parser)
   at Sitecore.Install.Items.ItemInstaller.InstallItem(BehaviourOptions installOptions, Item targetItem, ItemReference item, XmlVersionParser parser)
   at Sitecore.Install.Items.ItemInstaller.GetVersionInstallMode(PackageEntry entry, ItemReference reference, XmlVersionParser parser, ItemInstallerContext context)
   at Sitecore.Install.Items.ItemInstaller.InstallEntry(PackageEntry entry)
   at Sitecore.Install.Items.ItemInstaller.Flush()
   at Sitecore.Install.Items.LegacyItemUnpacker.Flush()
   at Sitecore.Install.Framework.SinkDispatcher.Flush()
   at Sitecore.Install.Utils.EntrySorter.Flush()
   at Sitecore.Install.Framework.EntryBuilder.Flush()
   at Sitecore.Install.Zip.PackageReader.Populate(ISink`1 sink)
   at Sitecore.Install.Utils.EntrySorter.Populate(ISink`1 sink)
   at Sitecore.Install.Installer.InstallPackage(String path, Boolean registerInstallation, ISource`1 source, IProcessingContext context)
   at Sitecore.Install.Installer.InstallPackage(String path, ISource`1 source, IProcessingContext context)
   at Sitecore.Shell.Applications.Install.Dialogs.InstallPackage.InstallPackageForm.AsyncHelper.<Install>b__0()
   at Sitecore.Shell.Applications.Install.Dialogs.InstallPackage.InstallPackageForm.AsyncHelper.CatchExceptions(ThreadStart start)

I noticed that the package.zip that I create (the inner zip file) is twice as large as original package.zip. How can I zip my folders again and recreate a package?

Please do not ask question: Why am I doing it, or if their is a different way to solve my problem. I am just interesting to learn what tool can I use to recreate a package from already existing folder structure.


Solution

  • Did you check that all of your items actually made it inside your 7zip file? The file paths inside a Sitecore package get quite long. And if you've unzipped the package to something like your desktop - 7zip can quite easily end up in trouble with some of the items you're trying to add and skip them.

    As far as I am aware, Sitecore doesn't do anything special in the zipping/unzipping of these archives. I have never looked into this in any detail though.