Configuring and running the EDB DMS agent in writer mode v1.3.10 (LTS)

Configure and run the EDB DMS agent in writer mode to perform a data migration only if the destination for your migration is a self-managed Postgres database. For migrations into a Hybrid Manager (HM)-managed database, you don't need an additional DMS agent in writer mode.

Prerequisites

  1. Ensure your machine has Java/OpenJDK 17 or later installed.

  2. Install the EDB DMS agent.

  3. Open the EDB DMS agent located in /opt/cdcagent/run-cdcagent.sh with write permissions.

Configuring the EDB DMS agent for migrations into self-managed Postgres

  1. Set the variables in the script according to your environment and uncomment the edited lines. See parameters for more guidance. The following shows the unedited script:
#!/bin/bash -e
# run_cdcagent.sh
#
# This script provides a convenient place to specify
# environment variables used to configure the
# EDB Data Migration Service Agent.
#

##########################################
# DMS Agent General Configuration       #
##########################################

# This ID is used to identify DMS Agent
# and is specified by the user.
export DBCONFIG_ID=<destination_name_of_choice>

# Determine the run mode of the DMS Agent
# The run mode can be set to either 'reader' or 'writer'
# 'reader' mode is used to read changes from a source database
# 'writer' mode is used to write changes to a target database
export RUN_MODE=writer

# This is the DMS backend service used by the DMS Agent
# Consult your system administrators
export RW_SERVICE_HOST=https://${TRANSPORTER_RW_SERVICE_DOMAIN_NAME}/transporter

##########################################
# DMS Agent TLS Configuration           #
##########################################

# You need to create migration credentials in EDB Postgres AI platform
# and set set the path of the credentials directory
export CREDENTIAL_DIRECTORY_PATH=$HOME/credentials

##########################################
# DMS Agent DB Configuration    #
##########################################

# A sample configuration to create a single postgres database connection:
export DBCONFIG_DATABASES_0__TYPE=POSTGRES
export DBCONFIG_DATABASES_0__HOSTNAME=<localhost/host>
export DBCONFIG_DATABASES_0__PORT=<5332>
# The CATALOG is the database name
export DBCONFIG_DATABASES_0__CATALOG=<destination_db_name>
export DBCONFIG_DATABASES_0__USERNAME=<postgres>
# The password env can be set without specifying it here
# but the env structure looks like this
export DBCONFIG_DATABASES_0__PASSWORD=<password>
# The resource_id is configured by the customer in the configuration file of the EDB Postgres AI agent
# need to make sure that the resource_id is set to the same value as in the EDB Postgres AI agent
#export DBCONFIG_DATABASES_0__RESOURCEID=1234567890abcdef

# You can increase the index to configure more than
# one database for the DMS Agent
#export DBCONFIG_DATABASES_1__TYPE=ORACLE
#export DBCONFIG_DATABASES_1__HOSTNAME=localhost
#export DBCONFIG_DATABASES_1__PORT=1521
# The CATALOG is the database name
#export DBCONFIG_DATABASES_1__CATALOG=ORCLCDB/ORCLPDB1
#export DBCONFIG_DATABASES_1__USERNAME=oracle
# The password env can be set without specifying it here
# but the env structure looks like this
#export DBCONFIG_DATABASES_1__PASSWORD=password
# The resource_id is configured by the customer in the configuration file of the EDB Postgres AI agent
# need to make sure that the resource_id is set to the same value as in the EDB Postgres AI agent
#export DBCONFIG_DATABASES_1__RESOURCEID=1234567890abcdef

##########################################
# Optional parameters below              #
##########################################

# FIPS mode can be enabled by setting the FIPS_MODE env variable to true
#export FIPS_MODE=true

# Configure logging
# Generic loglevel
#export QUARKUS_LOG_LEVEL=DEBUG
# Loglevel for a single package
#export QUARKUS_LOG_CATEGORY__COM_ENTERPRISEDB__LEVEL=DEBUG

cd "$(dirname "$0")"

echo "Starting in mode: $RUN_MODE"

case "$RUN_MODE" in
  reader)
    java -jar ./reader/quarkus-run.jar
    ;;
  writer)
    java -jar ./writer/quarkus-run.jar
    ;;
  *)
    echo "Unknown RUN_MODE: $RUN_MODE"
    exit 1
    ;;
esac

Running the EDB DMS agent

  1. Start the migration:

    cdcagent