Using the Azure Database Migration Service to transfer data from source to destination MySQL database servers.
When we want to transfer data and schema between databases whether they are on-premises or in the cloud, the azure data migration service instance comes helpful.
Some highlights:
One instance works across all subscriptions.
Can transfer between on-premises and cloud and cloud to cloud.
Pay-per-use billing.
Provides a wizard to create data transfer activity.
Some cons:
Limited features via IaC as compared to the portal but enough to get by.
Not recommended for developer instances or tiny databases that can be exported and imported via mysqldump.
binlog_expire_logs_seconds must be set to non-zero value on source server.
The steps to perform the data transfer activity between the source and destination MySQL servers involves:
Create a source mysql instance mysql-src-1 in rg-mysql-1
Create a database and add a table to mysql-src-1
Create a destination mysql instance mysql-dest-1 in rg-mysql-1
Deploy the DMS service instance and project.
Create and run an activity to transfer data.
Verify the data.
IaC:
resource "azurerm_database_migration_service" "single-to-flexible-dms" {
name = var.name
location = var.location
resource_group_name = var.resource_group_name
subnet_id = var.subnet_id
sku_name = var.sku_name
tags = var.tags
}
resource "azurerm_database_migration_project" "dms-project" {
name = format("prj-%s", azurerm_database_migration_service.single-to-flexible-dms.name)
service_name = azurerm_database_migration_service.single-to-flexible-dms.name
resource_group_name = azurerm_database_migration_service.single-to-flexible-dms.resource_group_name
location = azurerm_database_migration_service.single-to-flexible-dms.location
source_platform = try(var.source_platform, "SQL")
target_platform = try(var.target_platform, "SQLDB")
tags = azurerm_database_migration_service.single-to-flexible-dms.tags
depends_on = [
azurerm_database_migration_service.single-to-flexible-dms
]
}
No comments:
Post a Comment