Upgrade to 9: How to handle the missing page related views

Over the last couple of weeks we have worked on several upgrades of our existing sites to Kentico 9, which was released last month. While the upgrade process overall went pretty smooth, one issue popped up in almost all of our cases. In our projects we tend to leverage page related views (View_[ClassName]_Joined) in repeaters/univiews with custom queries which are removed during the upgrade process. This post will give you insights on how we handled this.

Experience matters

Before we start I would like to point out a nice post from Kentico MVP Andy Thompson who shared his experience with upgrading his company's site.

Why did they change it

Due to several performance optimizations in Kentico 9, the system will not generate the page related classes anymore. If you were used to using these views in your web parts and code or experience related issues after upgrade, than this is the time to rethink that strategy.

Recommended approach

Kentico's recommendation is to use DocumentQuery (DataQuery API) to handle data retrieval as it is optimized for performance. You can leverage this for example in DataSource web parts like the Macro data source.

Quick fix to workaround the issue

The alternative is to recreate the views. This won't however result in the performance improvements introduced with v9. For upgrades this is most certainly the fastest way to handle the missing views. My recommendation is to recreate the views as Custom views using the Database objects module. You can easily script them in SQL if you start the name of the view with View_Custom. Don't forget to update the name in your implementation though ;)

Custom views

Further reading

For more information on Kentico 9 upgrades check out the upgrades section and the official release notes.