Forms data cleanup


David te Kloese

From time to time you'll be needing data from the current live site on your development machine. For better testing, bug tracking or just to make sure you can experiment on live data without the risk of breaking something in front of live visitors. We have a policy about live data being transfered to non-production servers. For security reasons they should be cleaned of all personal data (mainly site visitors).

One of the locations this data is most likely to be in are the Forms (previously known as BizForms). They are typically full of names, email addresses, phone numbers. Data you won't want to be lying around on less protected servers/networks.

Since its easier to delete this data via SQL I usually just clear all Forms tables by an SQL script. Turns out however that the number of records inside each Form as you can see on the Forms listing page in Kentico still showed the old numbers. The number of records is stored after each alteration via Kentico and not calculated per view.

The DB table cms_form has an items column Bizz Form has no records

So when you delete Forms data by SQL, write a script to update these numbers in the CMS_Form table too to avoid confusion when in Kentico.