Skip to content

dataSync ​

Command: dataSync
Category: Data Tools
Status: Production Ready

Description ​

Synchronize data between systems or tables by reading rows from a source table and applying a sync strategy. You supply key columns to match rows and can select a sync mode and conflict resolution strategy.

Syntax ​

bash
hana-cli dataSync [options]

Aliases ​

  • datasync
  • syncData
  • sync

Command Diagram ​

Parameters ​

Positional Arguments ​

None.

Options ​

OptionAliasTypeDefaultDescription
--sourceConnection--scstring-Source connection profile.
--targetConnection--tcstring-Target connection profile.
--schema-sstring**CURRENT_SCHEMA**Schema name containing the table.
--table-tstring-Table name to synchronize.
--syncMode-mstringfullSynchronization mode. Choices: full, incremental.
--batchSize-bnumber1000Number of rows to process in each batch.
--conflictResolution--crstringsourceConflict resolution strategy. Choices: source, target, skip.
--keyColumns-kstring-Key columns for row matching (comma-separated).
--timeout--tonumber3600Operation timeout in seconds.
--profile-pstring-CDS profile for connections.

Connection Parameters ​

OptionAliasTypeDefaultDescription
--admin-abooleanfalseConnect via admin (default-env-admin.json).
--conn-string-Connection filename to override default-env.json.

Troubleshooting ​

OptionAliasTypeDefaultDescription
--disableVerbose--quietbooleanfalseDisable verbose output for scripting.
--debug-dbooleanfalseDebug hana-cli with detailed intermediate output.

Special Default Values ​

TokenResolves ToDescription
**CURRENT_SCHEMA**Current user's schemaUsed as default for --schema.

Output ​

The command reports rows read and a summary table showing sync mode, rows synced, batch size, and conflict resolution strategy.

Interactive Mode ​

In interactive mode, you are prompted for:

ParameterRequiredPromptedNotes
schemaNoAlwaysDefaults to current schema if omitted.
tableYesAlwaysTarget table to synchronize.
keyColumnsYesAlwaysComma-separated key columns.
sourceConnectionNoSkippedUse --sourceConnection when needed.
targetConnectionNoSkippedUse --targetConnection when needed.
syncModeNoSkippedUse --syncMode to switch modes.
timeoutNoSkippedUse --timeout to cap runtime.
profileNoAlwaysOptional CDS profile.

Examples ​

bash
hana-cli dataSync --sourceConnection conn1 --targetConnection conn2 --table myTable

Current Behavior Notes ​

The current implementation reads data from the source table and reports sync progress but does not yet apply changes to a target system. Options like --targetConnection, --syncMode, and --conflictResolution are accepted and reported in output but are not currently used to apply updates.

See the Commands Reference for other commands in this category.

See Also ​