Redgate Test Data Manager

Subsetting command-line reference - run

Runs the subsetter, subsetting from a source database to a target database.

rgsubset run
  --database-engine SqlServer
  --source-connection-string "[source connection string]"
  --target-connection-string "[target connection string]"
OptionRequired?Notes
--database-engine (tick)

The type of the database to classify.

Must be one of:

  • MySql 
  • Oracle 
  • PostgreSql 
  • SqlServer 
--source-connection-string (tick)

The connection string of the database to subset. Can also be set via a REDGATE_SUBSET_SOURCE_CONNECTION_STRING environment variable.

Example formats 

--target-connection-string(tick)

The connection string of the database to copy the subset to. Can also be set via a REDGATE_SUBSET_TARGET_CONNECTION_STRING environment variable.

Example formats 

--options-file(error)

The file path to an options file.

--target-database-write-mode(error)

Whether to fail or remove the rows if data is present in the target database.

Can be one of:

  • Strict (Default) : Subsetter returns an error if tables in the target database contains rows.
  • Overwrite : Subsetter will delete all rows from tables in the target database that are being subsetted to.
--dry-run(error)

Perform a dry-run with no subsetting.

This is a 'validation only' option that allows you to ensure your subsetting command line parameters and options file are configured correctly without modifying the database.

If issues are found, they are sent to STDOUT in a JSON structure. This gives you specific information about the issues, and helps you identify and fix any problems before they arise. 

--force(error)

Forces subsetting to run, ignoring certain validation errors that warn about unexpected results.

The validation the that runs before subsetting starts ensures subsetting is likely to succeed. However, some databases can trigger validation errors that subsetting could successfully work on. This option allows certain validation errors to be ignored, allowing subsetting to start:

  • the source database has no foreign keys
  • the target database has a different schema from the source

Subsetting with no foreign keys in the source database is unlikely to do what is desired, but can still produce a subsetted database.

Subsetting with some schema differences between the source and target database can succeed, but it is not always the case. 

If this option is used and subsetting then fails, it may be that the database is not in a state that can be successfully subsetted.

--output-file(error)The file to save a summary of what has been subsetted to.
--output (error)

The format to use for the output file.

Can be one of:

  • Json (Default)
  • Yaml

--log-level

(error)

The verbosity level to log at.

Can be one of:

  • Verbose
  • Debug
  • Information (Default)
  • Warning
  • Error
  • Fatal

--log-file

(error)

The location of the log file, or none to disable logging.

 -?, -h, --help 

(error)

Show help and usage information.



Didn't find what you were looking for?