Sunday 24 May 2015

Delete Record Store For An Endeca Application

In the process of removing an Endeca application we also need to remove related CAS record stores.

Here is the script that will help.

Save this as bat file then invoke from control folder of application you are removing.

==================================================================
setlocal

set CONTROL_DIR=%~dp0

call %CONTROL_DIR%\..\config\script\set_environment.bat
if not %ERRORLEVEL%==0 (
    echo Failed to set script environment.
    exit /B 1
)

set RS_PREFIX=%ENDECA_PROJECT_NAME%
set RS_LANG=%LANGUAGE_ID%

echo These record stores exist:
call %CAS_ROOT%\bin\component-manager-cmd.bat list-components
echo ==================================================

echo Dropping record stores (errors will occur on non-existent rs):
call %CAS_ROOT%\bin\component-manager-cmd.bat delete-component -n %RS_PREFIX%_%RS_LANG%_schema
call %CAS_ROOT%\bin\component-manager-cmd.bat delete-component -n %RS_PREFIX%_%RS_LANG%_dimvals
call %CAS_ROOT%\bin\component-manager-cmd.bat delete-component -n %RS_PREFIX%_%RS_LANG%_prules
call %CAS_ROOT%\bin\component-manager-cmd.bat delete-component -n %RS_PREFIX%_%RS_LANG%_data
echo ==================================================

echo Record stores deleted:
==================================================================

You can also create this script from initialize_rs_feeds.bat (located in conttrol folder). Remove content in this file after 

echo Creating fresh record stores.

Here is the output.In this case file is saved as Record_Store_Drop.bat and invoked from Store application.



No comments:

Post a Comment