Move custom module data from production to staging environment

Namita Patil asked on March 10, 2021 23:40

Hi,

We are working on one custom functionality, where we need to replicate the custom module data from production to QA. Once user change the data for custom module in production - we want it to be reflected in QA environment for same table.

Worst case - I might have to write a trigger on the data table for production sql DB for custom module, where it will be replicating the data to QA via linked server on update action. But, if there is any built-in functionality in Kentico 12, it will be great rather than going with this workaround. Please suggest some way here to achieve this functionality.

Thanks, Namita Patil

Correct Answer

Liam Goldfinch answered on March 11, 2021 01:42

Hi Namita,

For each Class in the Module you want to enable synchronization for, you need to configure the type definition by enabling content staging. The documentation describes how to do this.

But essentially you need to copy the Code of the class into your project and then you can configure it by adding:

SynchronizationSettings =
{
    LogSynchronization = SynchronizationTypeEnum.LogSynchronization,
    ObjectTreeLocations = new List<ObjectTreeLocation>()
    {
        // Adds the custom class into a new category in the Global objects section of the staging tree
        new ObjectTreeLocation(GLOBAL, "Custom")
    },
},
0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.