Sitecore publish vs transfer – which to use when and how?
This post will explain the difference between publish and transfer options in Sitecore, pros and cons of each approach and also which option to be used in which situation
If you are looking for more details on how to do publish or a transfer in Sitecore, go through his post: How to move sitecore items using publish and transfer options
Publish and transfer Differences:
1. Clearing Cache
Whenever an item is published in Sitecore, a number of tasks are performed in the background. One among those will clear the cache of the published item. This will ensure that the changes to your item in the production are visible and there are no cache issues.
Where as in transfer option, there won’t be any cache clear task performed. Sitecore just moves the items from one database to another database. We need to clear the cache manually using the cache clear tool.
2. Item hierarchy in target database
When an item is published from source database to target database, the item hierarchy cannot be changed in the target database. Say if you want to move an item ‘/sitecore/content/MySite /Products/sample’ to the target database, then it can be moved to the same hierarchy in the target database.
Where as in transfer option, we can move the item under any parent node in the target database. i.e., we can select the destination path in the target database while we are doing a transfer as shown in the figure below.
Which to use when?
If you want to move an item to a different location/path in target database, it can be achievable only through transfer option. In this case you can only use transfer option but not publish option.
If you are moving items from staging to production database i.e., from master to web database then it is recommended to use publish option but not transfer. because..
- As the item hierarchy in both staging and production would be same, there is no need to select destination path manually as it would be same.
- If you chose transfer, there might be a chance that you may make a mistake while selecting the destination path.
- Publish by default does a cache when you move items to production and does not require manual task.
When it is recommended to use Transfer?
Suppose you have published a stack of items from staging (master database) to production (web database) and it is taking some time to complete. Now you come across an item which needs to be moved to production right away and you cannot wait until the publishing queue completes. In this situation you can move that item using transfer option without waiting for publishing queue to complete. So just transfer that particular item and then clear cache using the Sitecore cache clear tool: Sitecore cache and cache clear tool
How to do a ‘Publish’ or ‘Transfer’ in Sitecore
For tutorial on how to do publish or a transfer in Sitecore, go through his post: How to move sitecore items using publish and transfer options