I am done with unicorn sync using gulp task provided in Sitecore habitat sample project. I need some clarification on below points.
As per my understating, if transparent Sync is enabled then auto sync (filesystem to sitecore) will happen but not auto serialization (Sitecore to filesystem). Is this possible to auto serialize too?
If I create a new item in Sitecore, will transparent Sync delete that item in sync process as it wont be available in file system till I serialize because the disk is considered the master at all times?
In sync process performed by gulp task in habitat sample project, it has synced the items in master and web both databases. Can I stop syncing to web automatically as I would prefer to publish in web database using Sitecore publish?
With transparent sync, the file system becomes the record for Sitecore. It treats the file system like the master database. For items and children that are monitored by transparent sync, if you create an item, TS will add it to the file system. If you delete an item from disk, it will be deleted from Sitecore. If you delete an item from Sitecore, it gets deleted from disk.
The file system becomes the same thing as the database.
Transparent Sync enables Unicorn to sync serialized items in real time, completely automatically. It does this by using its data provider to directly read the serialized items and inject them into the Sitecore content tree. The items on disk are the items in Sitecore: it bypasses the database entirely for transparently synced items. Changes made on disk update nearly instantly in the Sitecore editing interfaces.
Unicorn data provider is responsible to read/write to file system.
If transparent sync is ON then sync (file system to Sitecore) will happen automatically.
In transparent sync, for items controlled by Unicorn it bypasses the Sitecore database completely. It means file system is treated like the master database.
Sitecore to file system (serialization) will be automatic even if transparent sync is OFF.
Difference in serialization when transparent is sync is OFF and ON is when transparent sync is OFF then we still use the Sitecore databases and unicorn additionally serialized the items to the file system and when transparent sync is ON then item will be directly written to file system as file system behaves as master db.
To stop auto sync, we can remove or disable the Unicorn.DataProvider.config file. This still allows us to use the UI to de-serialize items (Sitecore to file system).