Skip to main content

DH Migration Scripts Guide


DH Migration Scripts Guide


1. Overview

This document describes the command-line arguments supported by the DH Migration scripts.

The migration framework consists of the following scripts:

ScriptPurposeDescription
Extraction.shExtract migration data from the source environment.Generates the migration package from the source environment.
Comparison.shGenerate comparison reports in the destination environment.Creates staging tables and generates the comparison report before migration.
Migration.shExecute migration and apply changes to the destination environment.Performs the actual migration and updates the destination environment.
Rollback.shRevert migration changes and restore the previous state.Rolls back comparison or migration changes when required.

2. Migration Scripts

2.1 Extraction.sh

The Extraction script is executed on the source environment to generate the migration package.

2.1.1 Supported Arguments

ArgumentDescription
ConfigFilePath to the configuration file containing database connection details and SH folder locations.
MigrationTypeSpecifies the migration type. Supported values are full and incremental.
AsOnDateCut-off date for data extraction. For full migration, specify the current date. For incremental migration, specify the date up to which data should be extracted from the source environment.

2.1.2 Example

./Extraction.sh <ConfigFile> <MigrationType> <AsOnDate>

2.2 Comparison.sh

The Comparison script is executed on the destination environment to generate the migration comparison report.

2.2.1 Supported Arguments

ArgumentDescription
ConfigFilePath to the configuration file containing database connection details and SH folder locations.
MigrationTypeDetermines the migration mode.

true → Incremental migration
false → Full migration
AsOnDateCut-off date used during migration processing. For full migration, specify the current date. For incremental migration, specify the extraction date used on the source environment.

2.2.2 Example

./Comparison.sh <ConfigFile> <MigrationType> <AsOnDate>

2.3 Migration.sh

The Migration script performs the actual migration and applies changes to the destination environment.

2.3.1 Supported Arguments

ArgumentDescription
ConfigFilePath to the configuration file containing database connection details and SH folder locations.
MigrationTypeDetermines the migration mode.

true → Incremental migration
false → Full migration
AsOnDateCut-off date used during migration processing. For full migration, specify the current date. For incremental migration, specify the extraction date used on the source environment.

2.3.2 Example

./Migration.sh <ConfigFile> <MigrationType> <AsOnDate>

2.4 Rollback.sh

The Rollback script is used to revert migration-related changes.

2.4.1 Supported Arguments

ArgumentDescription
ConfigFilePath to the configuration file containing database connection details and SH folder locations.
ModeSpecifies the rollback mode.

comparison → Removes only the staging tables created during comparison report generation.
last → Restores data from backup tables to the main tables.
FlowSideSpecifies whether the rollback is executed on the source or destination environment.

src → Updates the latest migration record in DHMigration from Transferred to Reverted.
dest → Updates the latest migration record in DHMigration from Received to Rollback.

2.4.2 Example

./Rollback.sh <ConfigFile> <Mode> <FlowSide>

3. Configuration File

All migration scripts require a configuration file containing:

  • Database connection details.
  • Source and destination environment information.
  • SH folder locations.
  • Migration-specific configuration parameters.

Ensure that the configuration file is validated before executing any migration-related scripts.


4. Best Practices

  1. Verify the configuration file before execution.
  2. Use the same AsOnDate value consistently throughout all migration steps.
  3. Generate and review the comparison report before executing the migration.
  4. Take backups before running migration scripts.
  5. Use the rollback script whenever a migration must be reverted.
  6. Retain migration logs and generated reports for auditing and troubleshooting purposes.