4

I have my Recursive Deploy action set to "Delete Sitecore Items not in the project".

Here is my Deployment Property Manager for the project: Deployment Property Manager

The purpose of the project is to remove all publishing targets except the 2 included targets.

When I deploy the update it successfully adds the two targets in the project, but it does not remove the existing publishing targets that are not in the project. Is there a reason for this? Are publishing targets protected from being deleted by updates?

Update: Here's the log info from the update:

6824 17:33:45 INFO Installing item '/sitecore/system' 6824 17:33:46 INFO Installing item '/sitecore/system/Publishing targets' 6824 17:33:46 INFO Installing item '/sitecore/system/Publishing targets/Target1' 6824 17:33:46 INFO Installing item '/sitecore/system/Publishing targets/Internet' 6824 17:33:46 INFO Installing file '_DEV\DeployedItems.xml' 6824 17:33:46 INFO Installing file 'bin\HedgehogDevelopment.SitecoreProject.PackageInstallPostProcessor.dll' 6824 17:33:47 INFO Committing files. 6824 17:33:47 INFO F:\\..\Website\sitecore\admin\Packages\PublishingTargets.update package was installed via SitecoreUpdateService with history path: F:\\..\Website\temp\__UpgradeHistory\Upgrade_PublishingTargets_20170823T223345304

This shows up a bit later in the logs, I manually deleted my test item:

5756 17:34:08 INFO AUDIT (sitecore\admin): Recycle item: master:/sitecore/system/Publishing targets/test, language: en, version: 1, id: {EB839CDC-03E9-4DA3-8547-09B091791427}
  • 1
    Do you have logs from the installation of the update package? There should be some lines where you can validate that your 'delete' setting is being executed and you may be able to see warnings/errors when it tries to delete it. – Jason St-Cyr Aug 24 '17 at 3:20
  • @Jason: I would suggest Add/Update using TDS is fine and avoid "delete" items as it can be mapped to multiple items as a reference and can break links – Siva Sankar Aug 24 '17 at 9:32
  • @JayS Updated the question with log info – Jason Aug 24 '17 at 14:36
2

Solved. The issue was I was running the update package through a bit of server code, rather than running a TDS sync in Visual Studio. The code being executed was:

UpdateHelper.Install(info, installationProcessLogger, out historyPath);

However, this does not execute post installation instructions that TDS uses to allow for field level deployments and child tree syncs. I added this code to fix my issue:

MetadataView metadata = UpdateHelper.LoadMetadata(packagePath); DiffInstaller diffInstaller = new DiffInstaller(UpgradeAction.Upgrade); diffInstaller.ExecutePostInstallationInstructions(packagePath, historyPath, InstallMode.Install, metadata, installationProcessLogger, ref entries);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.