title: Unicorn 3 sync'ing items to disk when transparent sync is not enabled
body: <p>I have a Sitecore 7.2 solution that I have installed Unicorn 3 into.</p>
  
  <p>I have used the default config file that is supplied. On development, I have enabled transparent sync after doing an initial sync</p>
  
  <pre><code>&lt;dataProviderConfiguration type="Unicorn.Data.DataProvider.DefaultUnicornDataProviderConfiguration, Unicorn" enableTransparentSync="true" /&gt; 
  </code></pre>
  
  <p>I have created a transofrm file so that when I deploy the solution to non development environments, it switches the enableTransparentSync back to false.</p>
  
  <p>Within this solution, there are some custom modules, and I am using the command Package Installer created by Benjamin Vangansewinkel
  (<a href="https://github.com/VGBenjamin/PackageInstaller" rel="nofollow">https://github.com/VGBenjamin/PackageInstaller</a>)</p>
  
  <p>When I run the command line to install a package, it its giving me an error indicating that it cannot write to the yml file to disk.</p>
  
  <p>Now I have checked the Unicorn.config file on this environment, and I can confirm that the enableTransparentSync is set to false.</p>
  
  <p>The package I am attempting to install is attempting to create items to /sitecore/content/Applications/Content Editor/Context Menues/Default/ and I can see that with the default configuration, everything within /sitecore/content/Applications/ will be sync'ed.</p>
  
  <p>On the dev machines, all the sitecore modules are installed, and the yml files under /sitecore/content/Applications/Content Editor/Context Menues/Default/ are serialized to disk.</p>
  
  <p>This may be my misunderstanding, but I thought that if transparent sync is disabled, then when changes are made into Sitecore, you have to go to the unicorn control panel and sync all the modifications manually. So why then am I getting errors about not being able to write changes to disk when transparent sync is not enabled.</p>
  
  <p>Now another option will be to delete the following lines from the default.config</p>
  
  <pre><code>&lt;include database="core" path="/sitecore/system/Field types"/&gt;
  &lt;include name="Core Settings" database="core" path="/sitecore/system/Settings" /&gt;
  &lt;include name="Core Start Menu" database="core" path="/sitecore/content/Documents and settings/All users"/&gt;
  &lt;include name="Core Applications" database="core" path="/sitecore/content/Applications"/&gt;
  </code></pre>
  
  <p>But before I do that I want to know why Unicorn appears to be using transparent sync.</p>
  
  <p>FYI: this is the full error stack</p>
  
  <pre><code>2016-03-22 15:38:15,996 [1] ERROR Sidewalk.SC.PackageInstaller.Client.Program [(null)] - System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.UnauthorizedAccessException: Access to the path 'D:\Websites\CI\Website\Unicorn\Default Configuration\Core Applications\Applications\Content Editor\Context Menues\Default\Bulk Export.yml' is denied.
     at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
     at System.IO.File.InternalDelete(String path, Boolean checkHost)
     at Rainbow.Storage.SerializationFileSystemTree.WriteItem(IItemData item, String path)
     at Rainbow.Storage.SerializationFileSystemTree.Save(IItemData item)
     at Unicorn.Data.DataProvider.UnicornDataProvider.SaveItem(ItemDefinition itemDefinition, ItemChanges changes, CallContext context)
     at Unicorn.Data.DataProvider.UnicornSqlServerDataProvider.SaveItem(ItemDefinition itemDefinition, ItemChanges changes, CallContext context)
     at Sitecore.Data.DataProviders.DataProvider.SaveItem(ItemDefinition item, ItemChanges changes, CallContext context, DataProviderCollection providers)
     at Sitecore.Data.DataSource.SaveItem(ID itemID, ItemChanges changes)
     at Sitecore.Data.Engines.EngineCommand`2.Execute()
     at Sitecore.Data.Engines.DataEngine.SaveItem(Item item)
     at Sitecore.Data.Managers.ItemProvider.SaveItem(Item item)
     at Sitecore.Data.Items.ItemEditing.AcceptChanges(Boolean updateStatistics, Boolean silent)
     at Sitecore.Install.Items.ItemInstaller.VersionInstaller.InstallVersion(Item version)
     at Sitecore.Install.Items.ItemInstaller.VersionInstaller.PasteVersion(XmlNode versionXml, Item target, VersionInstallMode mode, IProcessingContext context, Boolean removeOtherVersions)
     at Sitecore.Install.Items.ItemInstaller.InstallEntry(PackageEntry entry)
     at Sitecore.Install.Items.ItemInstaller.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.Installer.InstallPackage(String path, Boolean registerInstallation, ISource`1 source, IProcessingContext context)
     at Sitecore.Install.Installer.InstallPackage(String path, ISource`1 source, IProcessingContext context)
     at Sidewalk.SC.PackageInstaller.Service.SitecorePackageInstaller.InstallPackage(String path)
     --- End of inner exception stack trace ---
  System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.UnauthorizedAccessException: Access to the path 'D:\Websites\CI\Website\Unicorn\Default Configuration\Core Applications\Applications\Content Editor\Context Menues\Default\Bulk Export.yml' is denied.
     at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
     at System.IO.File.InternalDelete(String path, Boolean checkHost)
     at Rainbow.Storage.SerializationFileSystemTree.WriteItem(IItemData item, String path)
     at Rainbow.Storage.SerializationFileSystemTree.Save(IItemData item)
     at Unicorn.Data.DataProvider.UnicornDataProvider.SaveItem(ItemDefinition itemDefinition, ItemChanges changes, CallContext context)
     at Unicorn.Data.DataProvider.UnicornSqlServerDataProvider.SaveItem(ItemDefinition itemDefinition, ItemChanges changes, CallContext context)
     at Sitecore.Data.DataProviders.DataProvider.SaveItem(ItemDefinition item, ItemChanges changes, CallContext context, DataProviderCollection providers)
     at Sitecore.Data.DataSource.SaveItem(ID itemID, ItemChanges changes)
     at Sitecore.Data.Engines.EngineCommand`2.Execute()
     at Sitecore.Data.Engines.DataEngine.SaveItem(Item item)
     at Sitecore.Data.Managers.ItemProvider.SaveItem(Item item)
     at Sitecore.Data.Items.ItemEditing.AcceptChanges(Boolean updateStatistics, Boolean silent)
     at Sitecore.Install.Items.ItemInstaller.VersionInstaller.InstallVersion(Item version)
     at Sitecore.Install.Items.ItemInstaller.VersionInstaller.PasteVersion(XmlNode versionXml, Item target, VersionInstallMode mode, IProcessingContext context, Boolean removeOtherVersions)
     at Sitecore.Install.Items.ItemInstaller.InstallEntry(PackageEntry entry)
     at Sitecore.Install.Items.ItemInstaller.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.Installer.InstallPackage(String path, Boolean registerInstallation, ISource`1 source, IProcessingContext context)
     at Sitecore.Install.Installer.InstallPackage(String path, ISource`1 source, IProcessingContext context)
     at Sidewalk.SC.PackageInstaller.Service.SitecorePackageInstaller.InstallPackage(String path)
     --- End of inner exception stack trace ---
     at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
     at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
     at Sidewalk.SC.PackageInstaller.Client.ServiceReference.SitecorePackageInstaller.InstallPackage(String path) in C:\Projects\PackageInstaller\Sidewalk.SC.PackageInstaller.Client\Web References\ServiceReference\Reference.cs:line 88
     at Sidewalk.SC.PackageInstaller.Client.Program.Main(String[] args) in C:\Projects\PackageInstaller\Sidewalk.SC.PackageInstaller.Client\Program.cs:line 281
  </code></pre>
  
  <p>Where you can see the inner exception is trying to save the item to disk
         at Rainbow.Storage.SerializationFileSystemTree.WriteItem(IItemData item, String path)</p>
  
  <p><strong>Update</strong></p>
  
  <p>Just so everyone is aware, the issue is related to my CI environment, and I am getting the error as part of the deployment process.</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>I have read the blog post, <a href="http://kamsar.net/index.php/2015/10/Unicorn-Introducing-Transparent-Sync/" rel="nofollow">http://kamsar.net/index.php/2015/10/Unicorn-Introducing-Transparent-Sync/</a>, and I am obviously still understanding something.</p>
  
  <p>There is the following text:</p>
  
  <blockquote>
    <p>Note: you must perform an initial serialization of a configuration with Transparent Sync off before you enable it. Otherwise the items in the configuration will seem to disappear as transparent sync shows all zero items that are on disk!</p>
    
    <p>Turning transparent sync on is really easy: take the  you want to add transparent sync to and put this line in it:</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>Once Transparent Sync is enabled all you have to do is change items on disk and the updates will immediately appear within Sitecore.</p>
  </blockquote>
  
  <p>Reading that, I assume that if you can turn transparent sync on, then you can turn it off again.</p>
  
  <p>Reviewing the readme at <a href="https://github.com/kamsar/Unicorn" rel="nofollow">https://github.com/kamsar/Unicorn</a> I assume that to sync on your other environments, after doing a deployment, you can issue an http query to the control panel using the powershell.</p>
  
  <p>If you cannot turn off transparent sync, then what is the best practice for stopping transparent sync when I deploy to my CI environment? and using powershell to do the update.</p>
  
  <p>At present I only want transparent sync to work in development environments</p>