Loading Initial Data into a Target DB System

Unless the source server has no data when inbound replication is configured, a consistent snapshot of the data from the source server must be loaded into the target DB system.

It is recommended to use one of the following methods:
  • Logical export and import with MySQL Shell
    1. Export the data from the source server with MySQL Shell. See Exporting a MySQL Instance.
    2. Import the data into a new target DB system. See Importing Using the Data Import Feature.

      Alternatively, you can import the data into an existing target DB system with MySQL Shell. See Importing Using MySQL Shell. You should specify the updateGtidSet:"append" option so that the gtid_purged variable is populated with the GTID set of all transactions that have been executed in the initial data.

  • DB system backup and restore
    Note

    This method applies only when the source server is a HeatWave DB system.
    1. Backup the source DB system. See Creating a Manual Backup.
    2. Restore the backup to a new target DB system. See Restoring From a Backup.
      Note

      If the source and backup DB systems are located in different regions, you can copy the backup from the region of the source DB system to the region of the target DB system prior to the restore. See Copying a Backup to Another Region.
If GTID is enabled on the source server, these methods set the GTID values automatically on the target DB system. If you use a different method that does not set the GTID values, you have to invoke the sys.SET_GTID_PURGED stored procedure to update the gtid_purged variable.

Setting gtid_purged variable

If you need to set the gtid_purged variable prior to creating or enabling a channel, you can perform the following:
  1. Identify the set of GTID of all transactions that have been executed prior to the initial data loaded into the target DB system.
  2. Connect to the target DB system and add the GTID set to gtid_purged using the following command:
    CALL sys.SET_GTID_PURGED("+<gtidSet>")
    This command runs a stored procedure on the DB system to change the value of the gtid_purged system variable.
    • <gtidSet> is the value of the GTID set.
    • The + sign appends the GTID set to the DB system's gtid_purged system variable.