Hi. I have two applications on Azure, staging and production. Each application has its own database. Content sync is configured for staging => production. Creating objects in the staging application and transferring them to production using the sync button works fine. But what about deleting them? I want to delete an object in the staging application and have the changes automatically appear in production. Any ideas on how to implement this?
Using Xperience by Kentico version 31.5.1
Azure App
Content sync delete items
Answers
Hi Alex,
As far as I know, this is not currently supported by Content Sync. Deleted content items and pages cannot be synchronized to the target instance.
Initially, I was thinking about implementing this through a custom module using global events such as
AfterDeleteWebPageEvent,
AfterDeleteContentItemEvent,
AfterDeleteHeadlessItemEvent,
InfoObjectAfterDeleteEvent<T>.
The idea would be to detect the delete operation in the Staging environment and then automatically synchronize that delete to Production.
However, the challenge is that although we can detect the deletion event, Xperience by Kentico currently does not provide a mechanism to synchronize that delete operation to the target environment. If we had something similar to the "Synchronizing content using the API" capabilities available in Xperience by Kentico, we could potentially build a custom solution around it. In Xperience 13, I used a similar approach with staging tasks where create/update/delete operations could be automatically synchronized between environments.
Unfortunately, I don't see an equivalent capability for deleted items in Xperience by Kentico at the moment. So unless I'm missing something, I don't believe automatic delete synchronization is currently possible, even through a custom event-handler implementation.
Hopefully, this is something Kentico will support in a future release.
Useful links:
To response this discussion, you have to login first.