Export Data from the Subscriber Database
MATRIXX provides an example subscriber_export.yaml file to use with the data-export image to convert checkpoint data to CSV format. The image also generates script files to create SQL tables and load the exported subscriber data into the SQL tables.
Procedure
-
(Optional) Run the
/opt/mtx/bin/create_checkpoint.py file to create a new
checkpoint of the in-memory databases.
This step is necessary only if a recent checkpoint does not exist on the shared storage device. The publishing server creates these checkpoints at a configured interval. If you create a new checkpoint, specify the checkpoint directory with
MTX_INPUT_DIRECTORY
parameter. -
Run the
data-export image with the example
subscriber_export.yaml file as the entry for
MTX_EXPORT_CONFIG_FILE
or the file that you customized before.The following is an example using Docker:docker run --rm \ -v /temp/mtx/engine/config/output/mdc_config_custom.xml:/opt/mtx/conf/mdc_config_custom.xml \ -v /opt/mtx/shared:/shared \ -v /opt/mtx/data/export:/opt/mtx/data/export \ -v /matrixx-shared-logging-storage/Pricing/jdoe/subscriber_export.yaml:/opt/mtx/data/subscriber_export.yaml \ -e MTX_EXPORT_CONFIG_FILE="subscriber_export.yaml" \ -e MTX_VERSION=version \ -e MTX_OUTPUT_DIRECTORY_POSTFIX_EXP="echo "/$(date +"%Y%m%d-%H%M%S")"" \ my_registry/data-export:version \
Where my_registry is the name of your registry and versionis the version of your data-export image.Three sets of files are generated when the data-export image successfully completes:- Extracted subscriber data that is written to one or more CSV files.
- A script file to create SQL tables for importing the extracted subscriber data.
- A script file to load the exported subscriber data into the SQL tables after they are created.
- Run the create_tables.sql script to create new SQL tables.
- Run the load_tables.sql script to import the CSV data into the new SQL tables.