栏目头部广告

Tutorial for UDTS(Transfer MYSQL from UCLoud to UCloud Global)

一、Configurations on the Source Database Side (UCloud)

It is necessary to enable database access over the internet via NAT. The configurations are as follows:

图片31.png

After logging into your account, click on "UVPC"

图片32.png

Click on "Create NAT Gateway"

图片33.png

1、 Select the VPC where the MySQL database is located.

2、 Select the firewall (ensure that the MySQL port 3306 is allowed. If needed, you can create a new firewall by clicking "UNet").

3、 Enter the name for the NAT Gateway.

4、 Click on "Purchase Now"

图片34.png

After creating the NAT, click on "Port Forwarding"

图片35.png

Click on "Add Forwarding Rule"

图片36.png

1、 The Source IP is the public IP of the NAT gateway and port 3306.

2、 The Target IP is the internal IP of the MySQL database and port 3306.

3、 Enter the Name.

4、 Click on "OK"

图片37.png

The image above shows that the configuration was successful. You can access the MySQL database (internal IP 192.168.59.254) via port 3306 of the public IP 165.154.206.97.


二、Configurations on the Target Database Side (UCloud Gblobal)

First, we need to create the target database, log into the database to grant permissions, then create a NAT gateway to allow internet access, and finally use UDTS to migrate the database. The configurations are as follows:

图片38.png

After logging into your account, click on "UDB MYSQL"

图片39.png

Click on "Create Database"

图片40.png

1、 Select the region.

2、 Select the size of Memory

3、 Select the MySQL version (Note: The version of the target database must be equal to or higher than the source database's version to avoid potential compatibility issues).

图片41.png

Set the VPC and password for the database, then click on "Purchase Now"

图片42.png

The created database will be displayed in the console. Click on "Login"

图片43.png

Enter the account and password you just set, then click on "Go"

图片44.png

Click on "SQL", and enter the following command(Grant superuser permissions to the root):

update mysql.user set Super_priv='Y' where User='root';

flush privileges;

Then click on "Go"

图片45.png

The image above indicates that the command was executed successfully. You can now exit and return to the console.

图片46.png

图片47.png

Follow the steps outlined in "一、Configurations on the Source Database Side (UCloud)" to configure the target database, setting up a NAT gateway and port forwarding so that the target database can be accessed over the internet via the public IP 152.32.181.231 and port 3306.

图片48.png

Click on "All Products", then click on "UDTS"

图片49.png

Click on "Create Task"

图片50.png

Select your desired Service Type

图片51.png

After selecting the migration type as needed, click on "Set up Now" for the source database.

图片52.png

1、 Click on "Special Line Address", and enter the public IP and port 3306 of the source database's NAT gateway.

2、 Enter the MySQL database account and password for the source, along with the databases that need to be migrated (“*” represents all databases).

3、 Enable “NoLocks”

4、 Click on “determine”

图片53.png

Click on "Set up Now" for the target database.

图片54.png

1、 Select the region where you created the target database and choose the target database.

2、 Enter the MySQL database username and password for the target database.

3、 Click on "Determine".

图片55.png

Set the Task Name, then click on "Purchase Now".

图片56.png

The image above shows that the Pre-check was successful. Click on "Continue Buy"


图片57.png

图片58.png

Click on "Start", then click on "OK".

图片59.png

The image above shows that the database migration (UDTS) was successful.


文章详情页广告

Browse At Random.

底部广告
`