Brian McKeiver's Blog

11 Spring Cleaning Tips for Your Kentico Website - Part 2


Introduction

The sun is out, winter coats are disappearing, the BizStream barbecue grill is starting to be used at lunch time, ants are trying to invade our office, and baseball is back. This must mean that spring is in the air. It’s the time of year where getting some seasonal chores completed and setting up for summer is the norm.

As I was reflecting on the nice weather today on my commute home, I thought why not also use this time as reminder for all you Kentico developers and even Kentico marketers out there to do a little preventative maintenance on your CMS. It is easy to let small things like the items on this list slip by the cracks. Now would be a good time to address them especially if your Kentico site has been up and running for some time now. Without further ado, I have 11 tips that will keep your Kentico site in tip-top shape for 2015. 

Be sure to start out by reading part 1 of 11 Spring Cleaning Tips for Your Kentico Website.

 

6. Review SQL Database Statistics and Index Fragmentation

This item is very similar to the transaction log item above. Over time a database object such as an Index can become too big for its own good. As data is moved between pages in SQL Server sometimes it gets put not in the best location

Check out these free Index Statistic and Maintenance scripts for more info on how to review and correct this problem. Use them at your own risk however, I give no guarantees. And as always perform a backup first.

Keeping your SQL Database clean and optimized makes for a very happy Kentico application.

 

7. Object Version and Attachment Version History Clean Up

If you and your development team use Object versioning in Kentico then this tip is for you. Over time one of the main areas of growth, in terms of overall database size, in a Kentico application is the CMS_ObjectVersionHistory table. This table stores each version of all of the objects that you change in your Kentico site. If you have been running your site for a while, and it is being actively developed on each day by a team of people, the amount of rows can add up fast. I actually saw one Kentico site that we work on have its ObjectVersionHistory table grow to 7 GB of space used.

This is actually easier to happen than you might think. By default the Kentico setting for how many versions to keep is set to 5. However if someone has changed this setting to 0, which means unlimited version history, the table size just keeps growing. This is a good thing from the perspective of recovering from a problem, however, it is not the best thing in the world from a storage perspective. The solution to keep version history under control is simple. You can set a number of versions to keep in the Kentico settings application. Navigate to Kentico menu -> Settings -> Versioning & Synchronization -> Object versioning. Here you can set a limit on how many versions are kept in the system. We have started to set this value to between 5 and 8 in our sites as a way to keep this table from growing to multiple gigabytes.


Kentico Version Settings


If your version history table is large there are two things to try. First try deleting items from the Recycle Bin. If that still doesn't shrink the size then you are unfortunately relegated to writing some SQL statements like:
 

DELETE FROM [dbo].[CMS_ObjectVersionHistory] WHERE VersionID < 200


If you are a content admin who uses Kentico, the same goes for the CMS_AttachmentVersionHistory table. This is another culprit for large database sizes. This post and solution by a Kentico support engineer will tell you how to shrink your attachment table size. If you want to get a sense for how large your attachments are in your Kentico site there is a special page for that as well. Navigate to Kentico menu -> System -> Files -> Attachments. Here you can see whether the attachments are stored in the Database or FileSystem of your server. You can also sort the grid by Size to get a rough idea of how much space these items are taking.


Kentico Attachment Items
 

 

8. Rebuild Your Smart Search Index

If you use the Kentico Smart Search functionality to power your website search you should be aware of the fact that it creates indexes of your content based on how you configure it in the admin interface. Over time the index will rebuild itself as you add new content pages. But every once in a while, monthly or quarterly, it is a good idea to optimize the index. In my experience, index optimization does not happen on its own if you are running in production for a long period of time.


Kentico Smart Search Index


You can easily correct this by manually clicking the rebuild index button inside of the Smart Search application. Rebuilding the index manually will trigger the optimization to happen automatically as soon as it finishes. Be prepared though, this is a CPU intensive operation, perform it in non peak times on your website. 

 

9. Online Marketing Inactive Contacts Clean Up

This is a specific Kentico EMS tip. I wrote up an entire blog post on how to Ensure your Kentico EMS Site is Running at Peak Performance. Keeping your contacts in check is a good way to do this. At the very least take the spring cleaning season as a good opportunity to review what your Contact management application data looks like. Both contacts and activities. 

 

10. Online Marketing GeoIP / MaxMind Database Update

Kentico EMS has the ability to personalize your website visitor's experience. One strategy for content personalization is to base the content variant on the location of the visitor. Kentico uses the free MaxMind GeoIP database to do automaticlly detect from the visiting IP Address where in the world that visitor is coming from. By default the moment you install Kentico, you have a copy of that database file. It is in your App_Data directory.

The fact is, however, that over time IP addresses and locations changes and the MaxMind database becomes a bit stale. The good news here is that each month Kentico updates the client portal with an updated copy of the database file. To get this update you just need to log in to the client portal and download the file from there. Once you have it downloaded you can simply overwrite the database file in the ~/App_Data/CMSModules/WebAnalytics/MaxMind/ folder. This will keep your GeoLocation functionality up to date.


Kentico Geolocating Database

 

PRO TIP: You can purchase a subscription to MaxMind for an even more accurate database file that also includes a Company Name of the IP address lookup. This is a great way to create a visitor activity report in Kentico with some very useful information.
 

11. Hotfix Your Version of Kentico

I saved the best spring cleaning tip for last. As you probably know, Kentico has a very awesome 7 day bug fix policy. As long as you have a valid software maintenance agreement with them, you get these updates for free in the form of a hotfix. If you can't remember the last time you hotfixed your Kentico application, now is the time to start planning for running one. 


Kentico Installation Manager for Hotfixes

Kentico hotfixes include security patches, bug fixes, and sometimes, very rarely, small new feature additions. I do recommend staying current with the hotfix cycle. You can use the Kentico Installation Manager to help with running them.

 

Conclusion

I hope this post has inspired you to do some spring cleaning on your Kentico website. If you enjoyed these tips let me know via the comments of this blog post. I'd also love to hear from the Kentico development community if they have their own tips. If you do have another tip comment right here as well. Now I am off to go enjoy a cold refreshing beverage in the warm weather, root for the Red Wings to win another NHL playoff game, and watch the Tigers continue to dominiate on the baseball diamond. Happy Spring everyone.