Refresh Version History off DB Change

Eric Garrison asked on September 6, 2017 18:12

I have 100's of custom page type records that need a bulk update. A new field was added and then populated via a SQL Query. The problem is that the Form tab does not show the new value. The issue is that the [CMS_VersionHistory] is holding a version of the data pre- my change. Is there a way to refresh history from the CUSTOM_LISTING table?

I cannot edit the values in the of the version as the field is new and does not exist yet.

These custom page types don't really need history kept on them either. I just didn't see a way in Site Setting, Versioning or in the Page Type config to stop them from having History.

Correct Answer

Trevor Fayas answered on September 6, 2017 18:47

I would use the API found here:

https://docs.kentico.com/api10/content-management/pages#Pages-Updatingthelatesteditedversionofpages(pagesunderworkflow)

I would just create a temporary aspx page somewhere (like CMSPages), add a button and run this code on the click of it, finding your page types and doing the check out, update, checkin as described.

This is the downside of doing SQL updates, you want to try to leverage Kentico's API as much as possible as it will handle the versionining and such, it's risky making updates through the database. Plus if you have staging enabled, no pure-sql update will be caught so you can't push the change to the other environments.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Eric Garrison answered on September 6, 2017 20:17

Thanks Tevor. Sounds like a good plan.

0 votesVote for this answer Mark as a Correct answer

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