## zowe › dbm-db2 › execute › migration-script

Execute the migration script that was generated with the 'zowe dbm prepare migration' command to migrate Db2 objects (DDL) and table data from a source subsystem to a target subsystem. The source and target subsystem IDs are specified within the script.

For details about command usage for automation, see DBM-Db2 samples at https://github.com/BroadcomMFD/dbm-db2

#### Usage

zowe dbm-db2 execute migration-script <local-input-migrate-script-filename> [options]

#### Positional Arguments

- `local-input-migrate-script-filename` (string)

  - Specifies the local input migration-script file that was generated with the 'zowe dbm prepare migration' command.

#### Options

- `--restart` | `-r` (string)

  - Specifies the location in the script where you want to restart execution. The effects of previous successful script statement executions remain.

    The following restart options are valid:

    new - Restart execution of the script at the first statement.

    name, token - Restart execution of the script at the location in the restart section that is recorded in the specified token and that was returned from a prior execution failure.

    A section is a '.SYSTEM <name>' statement, where <name> identifies a logical grouping of statements such as UNLOADS or SQLDDL. 'source' is an alias for UNLOADS. 'target' is an alias for SQLDDL.

- `--error-file` | `--ef` (string)

  - Specifies the local output error file in YAML format. The file contains basic execution information, connection details, dbm-db2 profile parameters, used arguments, and errors that occurred during execution of the command.

    Default value: error.log

- `--modification` | `-m` (string)

  - Specifies a named set of server-managed default parameter values that control the execution behavior of the zowe dbm-db2 commands. For example, you can use a modification to identify a set of default values that differ from the current set of default values.

    For more information about using the modification option, see the DBM Data Service documentation at https://techdocs.broadcom.com/db2mgmt

#### Profile Options

- `--dbm-db2-options-profile` | `--dbm-db2-options-p` (string)

  - The name of a (dbm-db2-options) profile to load for this command execution.

- `--dbm-db2-profile` | `--dbm-db2-p` (string)

  - The name of a (dbm-db2) profile to load for this command execution.

- `--base-profile` | `--base-p` (string)

  - The name of a (base) profile to load for this command execution.

#### DBM-Db2 Connection Options

- `--protocol` (string)

  - Specifies the communication protocol between zowe dbm-db2 client and DBM Data Service.

    Allowed values: http, https

- `--job-cards` | `--jc` (array)

  - Specifies a string array of z/OS JCL JOB statements.

- `--work-dataset-prefix` | `--wdp` (string)

  - Specifies the prefix (high-level qualifier) in z/OS work data set names.

- `--delete-work-datasets` | `--dwd` (boolean)

  - Specifies whether to delete work data sets on a mainframe after the request is fulfilled.

- `--overwrite-output-files` | `--oof` (boolean)

  - Specifies whether to overwrite output files if they exist.

- `--base-path` | `--bp` (string)

  - The base path for your API mediation layer instance. Specify this option to prepend the base path to all DBM DS resources when making REST requests. Do not specify this option if you are not using an API mediation layer.

#### Base Connection Options

- `--host` | `-H` (string)

  - Host name of service on the mainframe.

- `--port` | `-P` (number)

  - Port number of service on the mainframe.

- `--user` | `-u` (string)

  - User name to authenticate to service on the mainframe.

- `--password` | `--pass` | `--pw` (string)

  - Password to authenticate to service on the mainframe.

- `--reject-unauthorized` | `--ru` (boolean)

  - Reject self-signed certificates.

    Default value: true

- `--token-type` | `--tt` (string)

  - The type of token to get and use for the API. Omit this option to use the default token type, which is provided by 'zowe auth login'.

- `--token-value` | `--tv` (string)

  - The value of the token to pass to the API.

- `--cert-file` (local file path)

  - The file path to a certificate file to use for authentication.

    Note: The CLI does not support certificate files that require a password. For more information, search Troubleshooting PEM Certificates in Zowe Docs.

- `--cert-key-file` (local file path)

  - The file path to a certificate key file to use for authentication

#### Examples

- Execute a migration script:

  - `zowe dbm-db2 execute migration-script migration.txt`

- Restart execution of a migration script at the first statement in the script:

  - `zowe dbm-db2 execute migration-script migration.txt --restart new`

- Restart execution of a migration script at the location in the token. Execution begins at the last successful sync point that is recorded in the restart token up to the end of the restart token section:

  - `zowe dbm-db2 execute migration-script migration.txt --restart target,78A724GOBLEDYGOOK6FD140F6780D6FA`