This topic describes migrating from an Amazon Relational Database Service (Amazon RDS) for MySQL instance of the VMware Tanzu Service Broker for AWS tile to an instance of the Tanzu Cloud Service Broker for AWS tile.

About Migrating Data to an Amazon RDS for MySQL Instance

Because the VMware Tanzu Service Broker for AWS (hereafter referred to as the legacy broker) tile is going out of support, you need to move from MySQL instances that the legacy broker created over to service instances that Cloud Service Broker for AWS created.

The Cloud Service Broker for AWS plans are configurable. When migrating, examine the configuration of the plans in use with the legacy broker and create matching plans in Cloud Service Broker for AWS.

You can use the AWS Data Migration Service (DMS) to migrate data between Amazon RDS for MySQL instances. The tool copies data from one database to another. Because the original database is not modified, you can reverse the migration if you detect any problems. It also allows migration to happen over time.

The DMS is a tool provided as part of AWS. For more information about AWS DMS, see the AWS documentation.

Matching Configuration

Both the legacy broker and Cloud Service Broker for AWS allow you to customize service plans. Create plans in Cloud Service Broker for AWS that match the plans used in the legacy broker. It might be useful to create a test service instance and compare the properties in the AWS console. For how to configure plans, see Configure Services with Cloud Service Broker for AWS.

Migrating Data

You might want to migrate data from instances created with the legacy broker to instances created with Cloud Service Broker for AWS.

Important: Migration of data might incur app downtime. The amount of downtime depends on the method chosen.

There are many methods for performing data migration, including AWS DMS, manual data migration, and methods available from other vendors. For more information about the data migration process, see the documentation for the method that you choose.

In general, to migrate data:

  1. Create a backup of the MySQL instance.
  2. Create an Amazon RDS for MySQL instance using Cloud Service Broker for AWS.
  3. Replicate the data from a legacy broker MySQL instance into the newly created instance.
  4. Unbind apps from the legacy broker MySQL instance and bind them to the newly created instance.
  5. After migration is complete you can stop on-going migration, and delete the legacy broker MySQL instance if you want to.

For more detailed steps showing the Cloud Foundry commands necessary to use AWS DMS, see Migrate Data from a Legacy MySQL Instance.

Migrate Data from a Legacy MySQL Instance

To migrate data from an existing legacy MySQL instance to Cloud Service Broker for AWS:

  1. Create a backup of the legacy MySQL instance.

  2. Get credentials for the legacy MySQL instance details by running:

    cf env APP-USING-LEGACY-SERVICE-INSTANCE
    

    Where APP-USING-LEGACY-SERVICE-INSTANCE is the name of an app that is bound to a service instance from the legacy broker.

  3. Inspect the VCAP_SERVICES JSON output to see the host name, database, user name, password, and port required to configure DMS.

  4. Create a new MySQL service instance using Cloud Service Broker for AWS by running:

    cf create-service csb-aws-mysql SERVICE-PLAN NEW-SERVICE-INSTANCE-NAME
    

    Where:

    • SERVICE-PLAN is the name of the MySQL service plan created to match the legacy instance configuration
    • NEW-SERVICE-INSTANCE-NAME is the name of the new MySQL service instance
  5. Create a service key in the new MySQL service by running:

    cf create-service-key NEW-SERVICE-INSTANCE-NAME SERVICE-KEY-NAME
    

    Where:

    • NEW-SERVICE-INSTANCE-NAME is the name of the new MySQL service instance
    • SERVICE-KEY-NAME is a name that you choose for the service key
  6. Get credentials from the service key by running:

    cf service-key NEW-SERVICE-INSTANCE-NAME SERVICE-KEY-NAME
    
  7. Inspect the JSON output for the host name, name, user name, password, and port required to configure the data migration.

  8. Configure and run data migration, such as by using AWS DMS. For how to configure data migration, see the documentation for the method you have chosen.

    Note: A data migration process might create schemas and tables without granting access for other users to work with that data. You can resolve this by connecting to the database with the credentials used for DMS, and granting binding_user_group access to the schemas and tables.

    Alternatively if you are not using a continuous migration method, such as AWS DMS change data capture (CDC), delete the service key used for data migration. This re-assigns data ownership to the binding_user_group role, automatically giving access to other users.

  9. Disconnect the app from the legacy service binding by running:

    cf unbind-service APP-NAME LEGACY-SERVICE-INSTANCE
    

    Where:

    • APP-NAME is the app using the MySQL instance.
    • LEGACY-SERVICE-INSTANCE is the name of the VMware Tanzu Service Broker for AWS-brokered MySQL instance.
  10. Bind the app to the new service instance by running:

    cf bind-service APP-NAME NEW-SERVICE-INSTANCE
    

    Where NEW-SERVICE-INSTANCE is the name of the Cloud Service Broker for AWS service instance that you created earlier.

    For example:

    $ cf bind-service my-app my-csb-aws-instance
    

    Because Cloud Service Broker for AWS creates new credentials at bind time, this creates new binding credentials for the app.

  11. Update the app to consume the new binding credential format. The legacy binding exposes the database name in the credentials block as database, whereas the binding credentials received from Cloud Service Broker for AWS exposes the database name as name. You must update the consuming app to handle the name credential property.

  12. Push and start the app by running:

    cf push APP-NAME
    
  13. After the migration finishes, you can stop continuous migration and remove the legacy service instance.

check-circle-line exclamation-circle-line close-line
Scroll to top icon