Tuesday 25 November 2014

Export the data from CAS Record Stores from one environment to other (ATG - ENDECA)

Hi,

When the baseline indexing is triggered from ATG, the product catalog data is exported from ATG to CAS Record Store Instances. The EndecaScriptService component then triggers the baseline update script of the Endeca Application to invoke the forge which loads the CAS record stores data and indexes the same based on the pipeline definition.

Sometimes when we want to debug the index of UAT/Production Environment in local we need to build the index in local with the same data that is in production. Since we use Endeca CAS record store instances which stores the data in binary format it is not straight forward to build the index in local with the same data.

We can follow the below steps to export the Endeca CAS Record Store Instances from one environment and other and index the same.

TASK1 : EXPORT THE ENDECA CAS RECORD STORE INSTANCES in UAT

Navigate to CAS Installation directory and list the record stores

/u01/home/app/atg/soft/endeca/CAS/11.0.0/bin >> sh component-manager-cmd.sh list-components

Note the Record Store Instances for the Endeca Application that you are interested in

Lifestyle_en_dimvals
Lifestyle_en_prules
Lifestyle_en_data
Lifestyle_en_schema

TASK 2: CHECK TO SEE THAT THERE ARE NO ACTIVE TRANSACTIONS ON THESE RECORD STORES

/u01/home/app/atg/soft/endeca/CAS/11.0.0/bin >> 
sh recordstore-cmd.sh list-active-transactions -a Lifestyle_en_dimvals
sh recordstore-cmd.sh list-active-transactions -a Lifestyle_en_prules
sh recordstore-cmd.sh list-active-transactions -a Lifestyle_en_data
sh recordstore-cmd.sh list-active-transactions -a Lifestyle_en_schema

TASK 3: FETCH THE CURRENT CONFIGURATION OF THE RECORD STORES TO XML FILES

/u01/home/app/atg/soft/endeca/CAS/11.0.0/bin >> 

sh recordstore-cmd.sh get-configuration -a Lifestyle_en_dimvals -f cfg_Lifestyle_en_dimvals.xml
sh recordstore-cmd.sh get-configuration -a Lifestyle_en_prules -f cfg_Lifestyle_en_prules.xml
sh recordstore-cmd.sh get-configuration -a Lifestyle_en_data -f cfg_Lifestyle_en_data.xml
sh recordstore-cmd.sh get-configuration -a Lifestyle_en_schema -f cfg_Lifestyle_en_schema.xml

TASK 4: READ THE RECORDS FROM RECORD STORE USING READ BASELINE AND WRITE IT TO AN XML FILE

/u01/home/app/atg/soft/endeca/CAS/11.0.0/bin >> 
sh recordstore-cmd.sh read-baseline -a Lifestyle_en_dimvals -f baseline_Lifestyle_en_dimvals.xml
sh recordstore-cmd.sh read-baseline -a Lifestyle_en_prules -f baseline_Lifestyle_en_prules.xml
sh recordstore-cmd.sh read-baseline -a Lifestyle_en_schema -f baseline_Lifestyle_en_schema.xml
sh recordstore-cmd.sh read-baseline -a Lifestyle_en_data -f baseline_Lifestyle_en_data.xml

Copy the configuration and baseline data files to another environments CAS Installations directory and run the below commands

TASK 5: SET THE CONFIGURATION OF RECORD STORES

C:\Oasis\Endeca\CAS\11.0.0\bin>

recordstore-cmd.bat set-configuration -a Lifestyle_en_dimvals -f cfg_Lifestyle_en_dimvals.xml
recordstore-cmd.bat set-configuration -a Lifestyle_en_prules -f cfg_Lifestyle_en_prules.xml
recordstore-cmd.bat set-configuration -a Lifestyle_en_schema -f cfg_Lifestyle_en_schema.xml
recordstore-cmd.bat set-configuration -a Lifestyle_en_data -f cfg_Lifestyle_en_data.xml

TASK 6: WRITE THE RECORDS TO THE RECORD STORES USING WRITE

C:\Oasis\Endeca\CAS\11.0.0\bin>

recordstore-cmd.bat write -a Lifestyle_en_dimvals -f baseline_Lifestyle_en_dimvals.xml
recordstore-cmd.bat write -a Lifestyle_en_prules -f baseline_Lifestyle_en_prules.xml
recordstore-cmd.bat write -a Lifestyle_en_schema -f baseline_Lifestyle_en_schema.xml
recordstore-cmd.bat write -a Lifestyle_en_data -f baseline_Lifestyle_en_data.xml

TASK 7: TRIGGER THE BASELINE UPDATE FROM THE ENDECA APP CONTROL DIRECTORY

The newly created index will be similar to the one in other environment from which the data is exported.

Hope this helps !!!