Migrating data between Watson Speech services service instances

Use the cpd-cli export-import commands to migrate data between Watson Speech to Text or Watson Text to Speech service instances. The service instances can be on the same instance of IBM® Software Hub or on different instances of IBM Software Hub.

Who needs to complete this task?
To complete this task, you must have one of the following roles on Red Hat® OpenShift® Container Platform:
  • Cluster administrator
  • Instance administrator
In addition, you must have one of the following permissions in IBM Software Hub:
On the source instance
You must have one of the following permissions on the instance of IBM Software Hub that you want to export data from:
  • Platform administration permission
  • Owner or an administrator of the service instance that you want to export data from
On the target instance
You must have one of the following permissions on the instance of IBM Software Hub that you want to import data to:
  • Platform administration permission
  • Owner or an administrator of the service instance that you want to import data to

Before you begin

Before you can export data from and import data to Watson Speech to Text or Watson Text to Speech, you must complete the following tasks:
  1. Creating a profile to use the cpd-cli management commands
    Important: If you are migrating data between different instances of IBM Software Hub, ensure that you create a profile for each instance of IBM Software Hub that you want to connect to.
  2. Preparing to use the IBM Software Hub export and import utility
  3. Initializing the export and import utility
Best practice: You can run many of the commands in this task exactly as written if you set up environment variables for your installation. For instructions, see Setting up installation environment variables.

Ensure that you source the environment variables before you run the commands in this task.

About this task

You can export data from and import data to one service instance at a time.
  • When you run the export command, you must specify the name of the service instance that you want to export data from.
  • When you run the import command, you must specify the name of the service instance that you want to import data to.
To view of list of the service instances that you have access to on an instance of IBM Software Hub, run the following command:
Watson Speech to Text service instances
cpd-cli service-instance list \
--profile=${CPD_PROFILE_NAME} \
--service-type=speech-to-text
Watson Text to Speech service instances
cpd-cli service-instance list \
--profile=${CPD_PROFILE_NAME} \
--service-type=text-to-speech

Procedure

To migrate data between Watson Speech to Text or Watson Text to Speech service instances:

  1. Export the data from the source service instance:
    1. Source the installation environment variables script for the instance of IBM Software Hub that you want to export data from.

      For example, if you named the script cpd_vars.sh, run:

      source ./cpd_vars.sh
    2. Log in to Red Hat OpenShift Container Platform as a user with sufficient permissions to complete the task.
      ${OC_LOGIN}
      Remember: OC_LOGIN is an alias for the oc login command.
    3. Set the EXPORT_NAME environment variable to the name that you want to use to identify the export job:
      export EXPORT_NAME=<name>
      Note: EXPORT_NAME can contain a maximum of 14 characters.
    4. Set the SOURCE_INSTANCE_NAME environment variable to the name of the service instance that you want to export data from:
      export SOURCE_INSTANCE_NAME=<instance-name>
    5. Run the appropriate command to export the data from the service instance:
      Watson Speech to Text service instances
      cpd-cli export-import export create ${EXPORT_NAME} \
      --namespace=${PROJECT_CPD_INST_OPERANDS} \
      --profile=${CPD_PROFILE_NAME} \
      --arch=x86_64 \
      --service-type=speech-to-text \
      --instance-name=${SOURCE_INSTANCE_NAME}
      Watson Text to Speech service instances
      cpd-cli export-import export create ${EXPORT_NAME} \
      --namespace=${PROJECT_CPD_INST_OPERANDS} \
      --profile=${CPD_PROFILE_NAME} \
      --arch=x86_64 \
      --service-type=text-to-speech \
      --instance-name=${SOURCE_INSTANCE_NAME}
  2. Wait for the export to complete. To check the status of the export, run:
    cpd-cli export-import export status ${EXPORT_NAME} \
    --namespace=${PROJECT_CPD_INST_OPERANDS} \
    --profile=${CPD_PROFILE_NAME} \
    --arch=x86_64
  3. Take the appropriate action based on the where you plan to import the data:
    Another service instance on the same instance of IBM Software Hub
    Go to step 4.
    Another instance of IBM Software Hub on the same cluster
    Source the installation environment variables script for the instance of IBM Software Hub that you want to import the data to.
    For example, if you named the script cpd_vars.sh, run:
    source ./cpd_vars.sh
    Another instance of IBM Software Hub on a different cluster
    1. Download the export file from the cluster:
      cpd-cli export-import export download ${EXPORT_NAME} \
      --namespace=${PROJECT_CPD_INST_OPERANDS} \
      --profile=${CPD_PROFILE_NAME} \
      --arch=x86_64

      The command generates a compressed file with following format: cpd-exports-<export_name>-<timestamp>-data.tar

    2. Source the installation environment variables script for the instance of IBM Software Hub that you want to import the data to.

      For example, if you named the script cpd_vars.sh, run:

      source ./cpd_vars.sh
    3. Log in to Red Hat OpenShift Container Platform as a user with sufficient permissions to complete the task.
      ${OC_LOGIN}
      Remember: OC_LOGIN is an alias for the oc login command.
    4. Set the EXPORT_ARCHIVE_FILE environment variable to the fully qualified name of the archive file:
      export EXPORT_ARCHIVE_FILE=<fully-qualified-name-of-TAR-file>
    5. Upload the archive file:
      cpd-cli export-import export upload \
      --file=${EXPORT_ARCHIVE_FILE} \
      --namespace=${PROJECT_CPD_INST_OPERANDS} \
      --profile=${CPD_PROFILE_NAME} \
      --arch=x86_64
  4. Set the TARGET_INSTANCE_NAME environment variable to the name of the service instance that you want import the data to.
    Important: The target instance must be the same type of service instance as the source instance. For example, if you exported the data from a Watson Speech to Text service instance, you must import the data to a Watson Speech to Text service instance.
    export TARGET_INSTANCE_NAME=
  5. Set the IMPORT_NAME environment variable to the name that you want to use to identify the import job:
    export IMPORT_NAME=<name>
  6. Import the data to the service instance:
    Watson Speech to Text service instances
    cpd-cli export-import import create ${IMPORT_NAME} \
    --namespace=${PROJECT_CPD_INST_OPERANDS} \
    --profile=${CPD_PROFILE_NAME} \
    --arch=x86_64 \
    --service-type=speech-to-text \
    --instance-name=${TARGET_INSTANCE_NAME} \
    --from-export=${EXPORT_NAME}
    Watson Text to Speech service instances
    cpd-cli export-import import create ${IMPORT_NAME} \
    --namespace=${PROJECT_CPD_INST_OPERANDS} \
    --profile=${CPD_PROFILE_NAME} \
    --arch=x86_64 \
    --service-type=text-to-speech \
    --instance-name=${TARGET_INSTANCE_NAME} \
    --from-export=${EXPORT_NAME}