[ Part 4 ] Data transfer & GTID purging
Steps to be implemented
Dumping data from MySQL source into Bucket
Save the @.json object
Loading data from Bucket into MySQL DB system
GTID purging
Following steps are implemented on the mysqlshellinstance host
Make sure you save the namespace of your bucket (in a notepad, etc). You will need it for steps 1.5 and 3.2.
You can find your namespace bucket with following command:
root@mysqlshellinstance:/home# oci os ns get
{
"data": "YourNamespaceBucket"
}
root@mysqlshellinstance:/home# [ 1 ] Dumping data from MySQL source into Object Storage (mdsbucket)
[ 1.1 ] Download sql script test1.sql under a location from where you will start the MySQL Client (in this example, we will implement the next steps under /home folder):
[ 1.2 ] Access MySQL client that is already configured on mysqlshellinstance from the same location you saved the test1.sql script:
[ 1.3 ] Execute the test1.sql with "source" command for creating the test database:
[ 1.4 ] Check if database and the populated tablespace are created:
[ 1.5 ] Access mysql-shell from localhost to dump data into mdsbucket with dumpInstance() utility:
...using dumpInstance() utility:
When data dump transfer is done, quit the MySQL-Shell:
[ 2 ] Save @.json file
[ 2.1 ] With OCI CLI, check if object @.json exists in mdsbucket:
Possible output
[ 2.2 ] If present, download @.json object with following OCI command:
Possible output:
[ 3 ] Loading data from Bucket into MySQL DB system
[ 3.1 ] From the same location where you saved the @.json file, you must access the MDS through the mysql-shell. This time, you will be using the utility loadDump().
[ 3.2 ] Apply loadDump() utility:
[ 3.3 ] Change to SQL mode:
... and check if the database has been migrated to MDS:
If migration has been implemented successfully, it is time to purge the GTID.
[ 4 ] GTID Purging
[ 4.1 ] Directly from SQL mode in mysql-shell, extract the gtidExecuted field from @.json file:
[ 4.2 ] Perform GTID purging in SQL mode with following command (obviously, our gtidExecuted value will be different)
[ 4.3 ] Perform checking
... and quit the MySQL-Shell:
Last updated