How to export only Business Application, Business Services and Recording Sessions with configexport & exclude unwanted user data from very large user/user group tables. Also how can the configexport/configimport be run as scripts with output saved to logs

Document ID : KB000032492
Last Modified Date : 14/02/2018
Show Technical Document Details

Question:

How to customise configexport/configimport utilities to just migrate the Business Application, Business Services and Recording Sessions. Configexport brings across user related data which we do not want to due to very large user/user group tables which we want to remove and start afresh with new monitoring data after changing the user identification specification.

 

Answer:

To achieve the desired result these 7 tables can be removed from the file EM_HOME/install/database-scripts/ConfigExport.xml:

====================================================== 

<IncludeTable name="ts_login_id_parameters" primaryKeys="ts_app_id, ts_type, ts_name"/> 

 

<IncludeTable name="ts_user_def_groups" primaryKeys="ts_id"/> 

<IncludeTable name="ts_user_groups" primaryKeys="ts_id"/> 

<IncludeTable name="ts_usergroup_id_parameters" primaryKeys="ts_app_id, ts_type, ts_name"/> 

<IncludeTable name="ts_usergroup_users_map" primaryKeys="ts_user_id, ts_user_incarnation_id, ts_usergroup_id"/> 

<IncludeTable name="ts_user_logins_map" primaryKeys="ts_app_id, ts_login_name"/> 

<IncludeTable name="ts_users" primaryKeys="ts_id"/> 

====================================================== 

Note all the ts_user* tables are removed except ts_user_importances because ts_domains has a foreign key dependency for ts_user_importances & removing it will cause an error on configimport.

 

Here are some example commands for Unix/Linux to save output to log files for subsequent checking. Similar syntax can be used on Windows.

NOTE: EM_HOME is the home directory for the EM installation:

1. Create directory for configexport/configimport file storage

cd EM_HOME

mkdir expimpfiles

2. Run configexport.sh to export the data as file export.xml:

JAVA_HOME=EM_HOME/jre;export JAVA_HOME

cd EM_HOME/install/database-scripts/unix

./configexport.sh localhost cemdb admin admin_password 5432 postgres EM_HOME/expimpfiles/export.xml > EM_HOME/expimpfiles/configexport.log 2>&1

3. Runconfigimport.sh to import the data from file export.xml:

JAVA_HOME=EM_HOME/jre;export JAVA_HOME

cd EM_HOME/install/database-scripts/unix

./configimport.sh -dbhost localhost -dbname cemdb -dbport 5432 -databasetype postgres -dbuser admin -dbpassword admin_pwd -dbscriptsdir EM_HOME/install/database-scripts -importfile EM_HOME/expimpfiles/export.xml -targetrelease "x.x.x.x" -postgresinstalldir /opt/CA/database -dbserviceuser postgres -dbservicepwd C@wilyapm96 -is64Bit true < yes_input.txt > EM_HOME/expimpfiles/configimport.log 2>&1

NOTE: The file yes_input.txt needs to be created in EM_HOME/install/database-scripts/unix beforehand. It just contains the single character y to avoid the prompt to validate the contents of input file export.xml.