Data Integrity

KonaKart includes a data integrity checking utility that can be used to check and optionally repair your data. The data integrity checker can be called directly using the KonaKart Admin API or indirectly by using one of the scripts provided.

The KonaKart data integrity checker is designed to be extended over time but currently covers the checking of Customer Group and Order Status Data Integrity only.

The KonaKart data shouldn't become corrupted under normal usage but if data is added to the KonaKart database through channels that don't preserve the integrity (such as via SQL commands) the database can lose its integrity. The purpose of the Data Integrity Checking utilities is to fix the data to restore it to a form that KonaKart can use. A common example of when the KonaKart database loses integrity is when languages are added to the system but records are not added for those languages to all KonaKart objects that must have a row for each language (for example for Order Status Names).

Executing the Data Integrity Checker from a Script

The scripts are provided in the KonaKart Enterprise Extensions Edition.

Open a command shell in the utils/dataIntegrity directory that can be found immediately under your KonaKart installation directory. You can find out the arguments that are required for running the utility by entering a "-?" as your argument as follows:


C:\Program Files\KonaKart\utils\dataIntegrity>checkDataIntegrity.bat -?

==================================================================================================
Check the Integrity of the KonaKart Database
==================================================================================================

Usage: DataIntegrityChecker
     -a  (0|1)                  - data area:
                                      0 = All
                                      1 = Customer Groups
                                      2 = Order Statuses
     -u  username               - username
     -p  password               - password
    [-s  storeId]               - storeId
    [-r]                        - attempt repair - default is false
    [-e  (0|1|2)]               - engine mode
    [-c]                        - shared customers - default is not shared
    [-ps]                       - shared products - default is not shared
    [-ae adminengine classname] - default is com.konakartadmin.bl.KKAdmin
    [-cu custom]                - custom option for DI Checker
    [-?]                        - shows this usage information
    

To run the data integrity checker just to check the integrity of the data, but not attempt to fix it, run it without the "-r" parameter. For example (lines have been broken up to show the output more clearly):


C:\Program Files\KonaKart\utils\dataIntegrity>
    checkDataIntegrity.bat -a 1 -u admin@konakart.com -p princess -e 2
    
==================================================================================================
Check the Integrity of the KonaKart Database
==================================================================================================

11-Sep 10:48:56 WARN  (AdminDataIntegrityMgr.java:checkCustomerGroups:142) 
    CustomerGroup record missing for Retail pt (id 1) language 5

To run the data integrity checker and attempt to fix any data integrity problems that are discovered, run it with the "-r" parameter. For example (lines have been broken up to show the output more clearly):


C:\Program Files\KonaKart\utils\dataIntegrity>
    checkDataIntegrity.bat -a 1 -u admin@konakart.com -p princess -e 2 -r 
    
==================================================================================================
Check the Integrity of the KonaKart Database
==================================================================================================
11-Sep 10:51:46 WARN  (AdminDataIntegrityMgr.java:checkCustomerGroups:142) 
    CustomerGroup record missing for Retail pt (id 1) language 5
11-Sep 10:51:46 WARN  (AdminDataIntegrityMgr.java:checkCustomerGroups:155) 
    CustomerGroup record added for: Retail pt (id 1) language 5