Closed vlaloggia closed 7 years ago
As an aside I would caution using a configuration predicate expressed this way. The include is huge, and the excludes are many. This will limit performance and be unmaintainable over time; as a best practice favor small specific includes as opposed to a monolithic tree.
Take it from me, I used to use monolithic trees ;)
It's also worth noting that the
<exclude name="App Center Sync"/>
<exclude name="Common"/>
<exclude name="List Manager"/>
<exclude name="Sample"/>
at the bottom is an invalid configuration and will throw an exception. The correct attribute is path
instead of name
I was unable to reproduce this issue. Here's what I did:
C:\MyDirectory\Unicorn\Master DB - Templates\templates\User Defined.yml
existed (it did)Here's the exact config:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<unicorn>
<configurations>
<configuration name="Dependent Configuration" description="Dependent Configuration" dependencies="Parent Configuration">
<targetDataStore type="Rainbow.Storage.SerializationFileSystemDataStore, Rainbow" physicalRootPath="C:\MyDirectory\Unicorn" useDataCache="false" singleInstance="true" />
<predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
<include name="Master DB - Templates" database="master" path="/sitecore/templates">
<exclude childrenOfPath="Branches">
<except name="User Defined"/>
</exclude>
<exclude childrenOfPath="CommerceConnect">
<except name="Products"/>
</exclude>
<exclude childrenOfPath="CommerceConnect/Products">
<except name="Product"/>
<except name="Product Relation"/>
<except name="Product Resource"/>
</exclude>
<exclude childrenOfPath="System">
<except name="Dictionary"/>
</exclude>
<exclude childrenOfPath="System/Layout">
<except name="Layout"/>
<except name="Layout Folder"/>
<except name="Placeholder"/>
<except name="Placeholder Settings Folder"/>
<except name="Renderings"/>
</exclude>
<exclude childrenOfPath="System/Layout/Renderings">
<except name="Controller rendering"/>
<except name="Rendering Folder"/>
</exclude>
<exclude childrenOfPath="System/Media/">
<except name="Media Folder"/>
</exclude>
<exclude childrenOfPath="System/Media/Unversioned">
<except name="File"/>
<except name="Image"/>
</exclude>
<exclude childrenOfPath="System/Media/Versioned">
<except name="File"/>
<except name="Image"/>
</exclude>
<exclude childrenOfPath="User Defined">
<except name="MWGSitecoreAccelerator"/>
</exclude>
<exclude path="App Center Sync"/>
<exclude path="Common"/>
<exclude path="List Manager"/>
<exclude path="Sample"/>
</include>
</predicate>
</configuration>
</configurations>
</unicorn>
</sitecore>
</configuration>
Hello Kamsar;
Thank you for catching my incorrect configuration.
I've another suggestion in reproducing this issue: I'm synching into a clean Sitecore install, not the Sitecore install from which the Serialization was produced.
Might I ask you to try synching into a Vanilla Sitecore installation to see if you can reproduce?
Thank you, vic
To your comment about the complex configuration: When synching into a vanilla Sitecore instance, if an intermediate directory doesn't exist, Unicorn is unable to create child items.
In our case, the /sitecore/Templates/Modules directory is added by the Powershell Extensions package, and is not present in the Sitecore content tree.
As such, I'm unable to create an include with path="/sitecore/templates/Modules" if I also have an include with path="/sitecore/templates", due to the overlapping paths constraint.
It is easier to fashion a giant configuration, such as the one above, rather than many small ones when one needs to cherry pick items.
When synching into a vanilla Sitecore instance, if an intermediate directory doesn't exist, Unicorn is unable to create child items.
That's right, and that's why we have configuration dependencies both implied and explicit. There's a sample config for it that goes over how it works.
Generally speaking you'll want to install any packages prior to syncing Unicorn as those form sort of the base system. Habitat, for example does this with the WFFM module - and dependencies for that matter.
Understood sir. Thank you for your time, and apologize for not divining this myself from your example configs.
vic
On Tue, Jan 24, 2017 at 10:21 PM, Kam Figy notifications@github.com wrote:
When synching into a vanilla Sitecore instance, if an intermediate directory doesn't exist, Unicorn is unable to create child items.
That's right, and that's why we have configuration dependencies both implied and explicit. There's a sample config for it https://github.com/kamsar/Unicorn/blob/master/src/Unicorn/Standard%20Config%20Files/Unicorn.Configs.Dependency.config.example that goes over how it works.
Generally speaking you'll want to install any packages prior to syncing Unicorn as those form sort of the base system. Habitat, for example does this with the WFFM module - and dependencies for that matter.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kamsar/Unicorn/issues/204#issuecomment-275008962, or mute the thread https://github.com/notifications/unsubscribe-auth/ATYgiG6OhPXySVI40YcDYefSxgEqQSZFks5rVr_SgaJpZM4Lrn8e .
-- Victor LaLoggia Sitecore Architect / Sitecore Lead
D: 802.654.9723 MyWebGrocer.com http://mywebgrocer.com/
Can't expect infinite docs-reading 😂 no apology needed.
Closing this one for the nonce.
Do you want to request a feature or report a bug? Bug What is the current behavior? Incorrect path returned by Rainbow.Storage.SerializationFileSystemTree.ConvertGlobalVirtualPathToTreeVirtualPath(string globalPath)
If the current behavior is a bug, please provide the steps to reproduce. Given the following configuration in the unicorn.config file:
When attempting to retrieve the file for Rainbow.Storage.TreeRoot "Master DB - Templates" "master":"/sitecore/templates/User Defined", an incorrect physical path is returned: "/User Defined".
This causes Rainbow.Storage.SerializationFileSystemTree.GetPhysicalFilePathsForVirtualPath(string) to return an incorrect path of: C:\your-path\Master DB - Templates\User Defined.yml
The correct path is C:\your-path\Master DB - Templates\templates\User Defined.yml
What is the expected behavior? The "User Defined.yml" file is found.
Please mention your Sitecore version and Unicorn version. Unicorn 3.3.2, Sitecore 8.1 rev. 160519