Striim Migration Service for Google Cloud Documentation

Create the target tables

Before running the initial load application, you must create tables in the target that are compatible with those in the source. You may use any tool you wish.

The simplest approach is to use the native utilities in MySQL and Cloud SQL for MySQL:

  1. In the source database, using mysql or any other client, enter one of the following commands to get the global transaction ID (GTID) or timestamp you will provide when starting streaming integration.

    If the source is MariaDB

    select @@gtid_current_pos;

    If the source is MySQL:

    select current_timestamp;
  2. Follow Google's instructions in Importing data into Cloud SQL.

  3. After completing the import to the target, in the same database, create the checkpoint table required for SMSGC to support recovery of the streaming integration application:

      id VARCHAR(100) PRIMARY KEY, 
      sourceposition BLOB, 
      pendingddl BIT(1), 
      ddl LONGTEXT);

This will create the target tables and perform the initial load including all foreign keys and other constraints, so after completing this step you should go on to Create and test the streaming integration application.

If you prefer to use SMSGC's schema conversion utility, the command is:

striim/bin/ \
-s="mysql" \
-d="mysql:@//<IP address>:<port>/<database>" \
-u="<user name>" \
-p="<password>" \
-b="<database_name.% or a list of tables separated by semicolons>" \

For detailed instructions on using the schema conversion utility, see Create target tables using SMSGC's schema conversion utility.