Configuration Parameters Shared by Applications

The following is an example of the configuration file fragment in the YAML format that lists configuration parameters used both in procopy and prosync:

source:
    driver_name: oracle
    host: enter host
    port: 1521
    database: enter database
    username: enter username
    password: enter password if necessary
    max_conn: 50
    options:
        - PREFETCH_ROWS=500
destination:
    driver_name: postgresql
    host: enter host
    port: 5432
    database: enter database
    username: enter username
    password: enter password if necessary
    max_conn: 50
    options:
        - sslmode=disable
tasks:
    - id: tab1
      table:
        source_table: source_table
        destination_table: destination_table
        include_columns:
            - field1
            - field2
            - field3
            - field4
        column_mapping:
            field1: field2
            field2: field1
        where: (COL1 IS NULL OR COL1 > 10) AND COL2 <> 'value'
      batch_bytes: 976.6KiB
      truncate: false
      transform:
        field1:
            null_to_value: ""
        field2:
            values_to_null:
                - "NULL"
                - NULL_VAL
                - INVALID
      snapshot_id: null
    - id: tab2
      query:
        sql: SELECT id, name FROM users ORDER BY id
        destination_table: users_table
        destination_columns:
            - id
            - login
      batch_bytes: 976.6KiB
      truncate: false
      snapshot_id: null
    - id: schema_task
      schema:
        source_schema: schema1
        destination_schema: schema2
        include_tables:
            - TABLE1
            - TABLE2
        table_mapping:
            TABLE2: main_table
      batch_bytes: 976.6KiB
      truncate: false
      snapshot_id: null

For how to set values for time configuration parameters, refer to Setting Time Values.

The following table explains configuration parameters that are used both in procopy and prosync:

Table 1. Configuration Parameters Shared Between Applications
Name Description Default Value Example

source

Parameters to connect to the source

source.dsn

DSN for the connection. If specified, this parameter has precedence: it defines the actual settings.

For BiHA cluster:

dsn: "postgresql://db-biha-1:5432,
db-biha-2:5432,
db-biha-3:5432/postgres?user=user&
password=password"

source.driver_name

Driver for the connection. Possible values: oracle, postgres, shardman.

source.host

Host name or IP address

source.port

Connection port

source.database

Name of the database to connect to

source.username

Connection login

source.password

Connection password. Leave empty if the password is not required.

source.max_conn

Maximum number of open connections

50

source.options

Additional connection parameters

options:
- PREFETCH_ROWS=500
- sslmode=disable

source.shards

Connection parameters for Postgres Pro Shardman, where each key is a shard name and the corresponding value is the connection parameters for the shard. Only used when source.driver_name is shardman. For each connection inside source.shards, the dsn parameter is only used.

shard-1:
    dsn: "postgresql://db-biha-1:5432,
    db-biha-2:5432,
    db-biha-3:5432/postgres?user=user&
    password=password"
shard-2:
    dsn: "postgresql://db-biha-4:5432,
    db-biha-5:5432,
    db-biha-6:5432/postgres?user=user&
    password=password"

source.shardman

Postgres Pro Shardman source configuration. Only used when source.driver_name is shardman.

0

source.shardman.api_port

Postgres Pro Shardman API port.

source.shardman.use_tls

Connect to Postgres Pro Shardman API through HTTPS.

false

source.shardman.insecure_skip_verify

Skip verification of the server’s transport layer security (TLS) certificate (for example, self-signed certificates).

false

source.shardman.http_timeout

Timeout of HTTP requests to Postgres Pro Shardman API.

10 s

destination

Parameters to connect to the destination

destination.dsn

DSN for the connection. If specified, this parameter has precedence: it defines the actual settings.

For BiHA cluster:

dsn: "postgresql://db-biha-1:5432,
db-biha-2:5432,
db-biha-3:5432/postgres?user=user&
password=password"

destination.driver_name

Driver for the connection. Possible values: oracle, postgres, parquet, shardman, axe.

destination.host

Host name or IP address

destination.port

Connection port

destination.database

Name of the database to connect to

destination.local_path

Absolute or relative path to the directory where files are stored for a parquet destination.

./parquet

destination.username

Connection login

destination.password

Connection password. Leave empty if the password is not required.

destination.max_conn

Maximum number of connections allowed for the connection pool

50

destination.options

Additional connection parameters

options:
- PREFETCH_ROWS=500
- sslmode=disable

tasks.table.destination_shard

Name of the shard to be used as the destination for this task.

destination.shards

Connection parameters for Postgres Pro Shardman, where each key is a shard name and the corresponding value is the connection parameters for the shard. Only used when destination.driver_name is shardman. For each connection inside destination.shards, the dsn parameter is only used.

shard-1:
    dsn: "postgresql://db-biha-1:5432,
    db-biha-2:5432,
    db-biha-3:5432/postgres?user=user&
    password=password"
shard-2:
    dsn: "postgresql://db-biha-4:5432,
    db-biha-5:5432,
    db-biha-6:5432/postgres?user=user&
    password=password"

destination.shardman

Postgres Pro Shardman destination configuration. Only used when destination.driver_name is shardman.

0

destination.shardman.api_port

Postgres Pro Shardman API port.

destination.shardman.use_tls

Connect to Postgres Pro Shardman API through HTTPS.

false

destination.shardman.insecure_skip_verify

Skip verification of the server’s transport layer security (TLS) certificate (for example, self-signed certificates).

false

destination.shardman.http_timeout

Timeout of HTTP requests to Postgres Pro Shardman API.

10 s

destination.path

Path to the Postgres Pro AXE files inside the bucket or in the local file system. This parameter is required even for an S3 bucket, because Postgres Pro AXE requires files outside the bucket root. It is used only when destination.driver_name is axe.

axe

destination.folder_name

Name of the directory on the Postgres Pro AXE server where Parquet files are placed. This parameter must match the name of the directory created by the axe.create_folder stored procedure on the Postgres Pro AXE side. It is used only when destination.driver_name is axe.

axe

destination.folder_path

Path of the directory on the Postgres Pro AXE server where Parquet files are placed, relative to destination.path. It is used only when destination.driver_name is axe.

in

destination.parquet_connection

Section that specifies where procopy writes Parquet files: to a local directory or to an S3 bucket. It is used only when destination.driver_name is axe or parquet.

destination.parquet_connection.local_path

Path to the local directory where Parquet files are stored. Specify either this parameter or destination.parquet_connection.s3.

/var/lib/postgresql/axe

destination.parquet_connection.s3

Section that specifies the connection to an S3 bucket where Parquet files are stored. Specify either this parameter or destination.parquet_connection.local_path.

destination.parquet_connection.s3.bucket

Name of the S3 bucket.

axe

destination.parquet_connection.s3.region

Region of the S3 bucket.

us-east-1

destination.parquet_connection.s3.endpoint

Endpoint (URL) of the S3 service.

https://s3.example.com

destination.parquet_connection.s3.cert_path

Path to the certificate used for authorization. This is an optional parameter.

destination.parquet_connection.s3.access_key

Access key for S3 authorization.

destination.parquet_connection.s3.secret_key

Secret key for S3 authorization.

destination.parquet_connection.s3.tmp_path

Path where procopy temporarily stores files before uploading them to the S3 bucket.

/var/lib/procopy/tmp

tasks

List of tasks. A task can be of the Query, Schema, or Table type. For more details, refer to Types of Tasks.

tasks.id

Task name. Must be unique. It is recommended to avoid changing it between tasks.

ID: "task_schema_1"

tasks.table

Section for a task of the Table type. For more details, refer to Types of Tasks.

tasks.table.source_table

Qualified name of the source table: <schema>.<table>. The names that are specified without quotes are meant to be case-insensitive.

source_table:
"SYSTEM"."PRODUCTS"

tasks.table.destination_table

Qualified name of the destination table: <schema>.<table>. The names that are specified without quotes are meant to be case-insensitive.

destination_table:
"public"."products"

tasks.table.exclude_columns

List of columns to exclude from data loading. List columns with case-sensitive names exactly as they are called in the source DB. Quotes are not needed. Incompatible with tasks.table.include_columns.

exclude_columns:
- COLUMN_1
- COLUMN_2

tasks.table.include_columns

List of columns such that only these columns will be loaded. List columns with case-sensitive names exactly as they are called in the source DB. Quotes are not needed. Incompatible with tasks.table.exclude_columns.

include_columns:
- COLUMN_1
- COLUMN_2

tasks.table.column_mapping

Mapping of column names in the source database to names in the destination database if these names are different, in the format <source_name>: <destination_name>. Specify columns with case-sensitive names exactly as they are called in the appropriate DB. Quotes are not needed.

column_mapping:
  "COLUMN_1": "new_column_1"
  "COLUMN_2": "new_column_2"

tasks.table.where

Filtering conditions for the source table, which enables limiting the number of rows to load. An SQL statement that returns boolean.

where: "(COL1 IS NULL OR COL1 > 10) AND COL2 <> 'value'"

tasks.table.dst_shard_filter_mapping

For a Postgres Pro Shardman destination, mapping of filtering conditions for source table rows to shards in the destination cluster. When transferring data to sharded or global tables, this parameter is ignored and all the rows are sent to the first shard.

dst_shard_filter_mapping:
  shard_1: mod(XINT, 4) = 0
  shard_2: mod(XINT, 4) = 1
  shard_3: mod(XINT, 4) = 2
  shard_4: mod(XINT, 4) = 3

tasks.table.allow_string_to_int_cast

Allows casting values of string columns, used in filtering conditions of tasks.table.dst_shard_filter_mapping, to a numeric type when a numeric column value arrives from the source as string. Can only be specified together with tasks.table.dst_shard_filter_mapping.

false

tasks.table.default_value

Value to be used for a column that could not be cast to a numeric type when tasks.table.allow_string_to_int_cast is enabled. tasks.table.default_value can only be specified when tasks.table.allow_string_to_int_cast is true. If it is not specified or its value contains an illegal (non-numeric) character, prosync completes with an error.

tasks.table.log_default_value_usage

Log each table row where tasks.table.default_value was applied. This is useful to see each row that does not match conditions specified in tasks.table.dst_shard_filter_mapping. Can only be specified together with tasks.table.dst_shard_filter_mapping and tasks.table.default_value.

false

tasks.table.single_loader

Transfer operations on this table with a single loader if prosync_options.loaders > 1. Use if operations on the table must be applied sequentially because of foreign keys or other dependencies.

tasks.table.uniq_keys

Unique key to be used for the selection. If not specified, the most suitable key will be chosen automatically.

tasks.table.last_row

Deprecated

tasks.table.index_hint

A hint for an index name to be used for an index scan. In some situations, the index that is actually chosen for the index scan can differ from the one specified.

index_hint: "/+ INDEX (employees emp_department_ix)/" # Oracle
index_hint: "/+ IndexScan(tableName indexName)/" # Postgres Pro
index_hint: "/+ IndexScanOnly(tableName indexName)/" # Postgres Pro

tasks.table.disable_order_by

Disables sorting during a selection. If not specified, the global setting from procopy_options is used.

tasks.table.destination.shard

Name of the shard to be used as the destination for this task.

tasks.query

Section for a task of the Query type. For more details, refer to Types of Tasks.

tasks.query.sql

User’s SQL query for the task

sql: "SELECT id, name FROM users ORDER BY id"

tasks.query.destination_table

Qualified name of the destination table: <schema>.<table>. If the schema name or table name is specified without quotes, this name is meant to be case-insensitive.

destination_table:
"public"."products"

tasks.query.destination_columns

List of destination columns where data will be inserted. Column names must be in the same order as in the query. List columns with case-sensitive names exactly as they are called in the destination DB. Quotes are not needed.

destination_columns:
- id
- login

tasks.query.destination_column_types

Types of destination columns where data will be inserted. Must be listed in the same order as in tasks.query.destination_columns. Only used to migrate data to the Parquet format. Type names must follow the types of the source DB. Therefore, Parquet types should not be used here.

For migration

PostgreSQL → Parquet:

destination_column_types:
- text
- integer
- boolean

tasks.schema

Section for a task of the Schema type. For more details, refer to Types of Tasks.

tasks.schema.source_schema

Name of the source schema to load. Must be exactly as in the database. No quotes are needed.

source_schema: SYSTEM
source_schema: BOOK.shelves

tasks.schema.destination_schema

Name of the destination schema. Must be exactly as in the database. No quotes are needed.

destination_schema: public
destination_schema: book.SHELVES

tasks.schema.exclude_tables

List of tables to exclude from the data loading. List tables with case-sensitive names exactly as they are called in the source DB. Quotes are not needed. Incompatible with tasks.schema.include_tables.

exclude_tables:
- PRODUCTS
- TOKENS

tasks.schema.include_tables

List of tables such that only these tables will be loaded. List tables with case-sensitive names exactly as they are called in the source DB. Quotes are not needed. Incompatible with tasks.schema.exclude_tables.

include_tables:
- PRODUCTS
- TOKENS

tasks.schema.table_mapping

Mapping of table names in the source database to names in the destination database if these names are different, in the format <source_name>: <destination_name>. List tables with case-sensitive names exactly as they are called in the appropriate DB. Quotes are not needed.

table_mapping:
  "source_name_tab1": "destination_name_tab1"
  "source_name_tab2": "destination_name_tab2"

tasks.batch_bytes

Limitation on the batch size for the current task, in bytes. If not specified, the global limitation procopy_options.batch_bytes is used.

tasks.truncate

If enabled, a destination table (tables) will be truncated before the data loading. If not specified, the global flag procopy_options.truncate is used.

tasks.force_restart_task

Allows you to rerun the task without changing its id or setting the task.truncate parameter. This is useful, for example, when you need to rerun the task with the same id but with a different tasks.table.where condition. If not specified, the global parameter procopy_options.force_restart_task is used. Incompatible with the global or task-level truncate configuration parameter. prosync ignores the task.force_restart_task parameter.

tasks.transform

Rules to transform null values of the specified columns. Each rule can contain the following fields:

  • null_to_value contains the value to which null values of the column will be converted during the data loading.

  • values_to_null contains an array of column values to be converted to null during the data loading.

  • null_char_replace contains a string to replace the symbol with the zero code (\0x00, CHR(0)). It can be one symbol, a longer string, or an empty string.

    For tasks of the Schema type, if keys do not contain dots, all the columns with this name in all tables will be processed according to the specified rules. And if keys contain a dot, the first dot will be considered as a separator of the table name from the column name, so the column in only one table will be processed.

    It is important to specify tables and columns in the same case as in the destination DB.

transform:
column1:
null_to_value: "UNKNOWN"
null_char_replace: "\n"
table1.column2: # for tasks of the Schema type
values_to_null: ["NOTSET", "notset", "NotSet"]

tasks.disable_index_hint

Disables index hints when creating select queries. If not specified, the global flag procopy_options.disable_index_hint is used.

tasks.window_rows_limit

Size of the sliding window. Number of rows selected at a time. If not specified, the global value of the procopy_options.window_rows_limit is used.

tasks.encoder_chan_size

Size of a buffer used by encoders.

tasks.snapshot_id

Identifier of the PostgreSQL/Postgres Pro snapshot. If not specified, the global value of the procopy_options.snapshot_id is used.

tasks.enable_auto_snapshot

If true, a snapshot is created in PostgreSQL/Postgres Pro to be used to get data.

tasks.sub_task_rows

Deprecated. Use procopy_options.sub_tasks_count instead. Number of rows in a task for parallel reading of tables. Used to split reading large tables into subtasks. The value of zero turns off splitting into subtasks.

0

tasks.sub_tasks_count

Number of subtasks for parallel reading of tables. Used to split reading large tables into subtasks. The value of zero turns off splitting into subtasks. The maximum value is 1000.

tasks.ignore_operations

Skip the specified operations. You can specify update, delete, or truncate operations. Be cautious: if it is specified to skip delete operations and you skip delete operations with a certain key, INSERT with this key will be further ignored. The value of [] indicates that no operations are skipped. Other possible values list operations to skip:

ignore_operations:
  - delete
  - update
  - truncate

tx_storage

Parameters to connect to the supporting DB to be used to store transactions. If not specified, the destination DB is used.

tx_storage.dsn

DSN for the connection. If specified, this parameter has precedence: it defines the actual settings.

For BiHA cluster:

dsn: "postgresql://db-biha-1:5432,
db-biha-2:5432,
db-biha-3:5432/postgres?user=user&
password=password"

tx_storage.driver_name

Driver for the connection. Possible values: oracle, postgres.

tx_storage.host

Host name or IP address

tx_storage.port

Connection port

tx_storage.database

Name of the database to connect to

tx_storage.username

Connection login

tx_storage.password

Connection password. Leave empty if the password is not required.

tx_storage.max_conn

Maximum number of open connections

50

tx_storage.options

Additional connection parameters

options:
- PREFETCH_ROWS=500
- sslmode=disable

storage

Parameters to connect to the supporting DB to be used to store the prosync state. If not specified, the destination DB is used.

storage.dsn

DSN for the connection. If specified, this parameter has precedence: it defines the actual settings.

For BiHA cluster:

dsn: "postgresql://db-biha-1:5432,
db-biha-2:5432,
db-biha-3:5432/postgres?user=user&
password=password"

storage.driver_name

Driver for the connection. Possible values: oracle, postgres.

storage.host

Host name or IP address

storage.port

Connection port

storage.database

Name of the database to connect to. A Postgres Pro Shardman database cannot be used. You can connect to a single shard with the postgres driver if needed.

storage.username

Connection login

storage.password

Connection password. Leave empty if the password is not required.

storage.max_conn

Maximum number of open connections

50

storage.options

Additional connection parameters

options:
- PREFETCH_ROWS=500
- sslmode=disable