1
votes

We use Kentico 8.2 and have Development, Test, Stage, and Production environments. From time to time we refresh a content tree in a lower environment with what is currently in Production. Kentico supports this, but after doing a full synchronization of the tree, the nodes are out of order in large part. To sync all the node orders manually is quite labor intensive. How can we accomplish this automatically? Is this supported natively in Kentico?

One idea I had was to just use a simple update statement in T-SQL that joins the Production CMS_Tree table to the same table in, say, the Test environment (joining on NodeAliasPath) and sets the NodeOrder in Test equal to the NodeOrder value in Production.

We try not to do much direct data manipulation in the database itself, for fear of unknown side effects. In this case, would such an update to the node orders adversely affect anything else in the database or Kentico app?

3
You are manually refreshing it from production only a lower environment? What method are you using to do this "refresh"? - probrandono
@probrandono Yes, refresh from Production to a lower environment only. To move from Dev > Test > Stage > Prod, we use the Staging app as "normal". The method is synchronizing the entire content tree from the source environment to the target. - neizan
What is the node order settings you have in the system>settings? - Chetan Sharma
@ChetanSharma I can't find "System > Settings", but under the Settings app, and under Content > Content management, I find "New page order" setting set to "Alphabetical"... - neizan
Yes that's the same as I have and after that I would go to the root of the tree and press "Sync entire content tree" button. However, this is strange that it is not working out for you. I usually follow this routine to sync and if in case any particular sub-level is out of sync I will repeat the process however it get's difficult if your content tree is deeply nested. - Chetan Sharma

3 Answers

1
votes

Going to staging > pages> and selecting your top level page, then click synchronize current subtree should sync the pages and their order correctly. You may have to delete all the pages on the target server before syncing to verify everything lines up. If it doesn't work, it could be a bug, are you on the latest hotfix?

0
votes

It is not clear what do you mean by nodes out of order, but the thing with staging is that it tries to keep the whole content synchronized = in the same state by creating small staging tasks, when updating documents (even moving them around).

With complete synch it pushes the content and its whole structure back so when you change order of nodes on lets say production it tries to push it down on the lower ones and during the process it either rewrites documents or creates new one based on their current order and it in CMS_Tree table, but since it may have missed few smaller tasks for other documents you end up with nodes out of the place.

Why not stage more often or use task generated for this to keep both of them synchronized, otherwise you may end up with inconsistent environments and staging exceptions.

You are correct and direct DB manipulation, especially on content tree, is not advised as there are FK constraints, but it could still cause a terrible mess so I would advise against it.

-1
votes

Here's what I will do. From the target server I will delete the content tree if i have to match from the source server. Considering this is true, I will now do a content refresh from source to the target server.

I have done this multiple times and works like a charm.