Database Migration Service uses migration jobs to migrate data from your source databases to the AlloyDB for PostgreSQL destination cluster. Migration jobs help you organize the source and destination connection profiles, define settings specific to the migration process, monitor the progress, and safely finalize the whole operation.
Creating a migration job includes performing the following tasks:
Selecting source and destination connection profiles.
Selecting the conversion workspace and specifying objects you want to migrate.
Performing a migration job test to ensure that Database Migration Service is able to connect to your data source and destination.
Starting the migration job, and monitoring the progress.
Promoting the migration job when you want to switch your application to the new instance.
Before you begin
- Ensure you meet the following requirements:
- Your configured your source database for migration.
- You configured source network connectivity.
- You have the source connection profile for your database.
- You created and configured your destination AlloyDB for PostgreSQL instance.
- You configured destination network connectivity.
- You have the destination connection profile for the AlloyDB for PostgreSQL instance.
- You converted your source SQL Server schema with a Database Migration Service conversion workspace.
- Optional: If you want to manage your own certificates for the migration job, you prepared the necessary encryption keys.
- In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
- Enable the Database Migration Service and AlloyDB for PostgreSQL Admin APIs.
Required roles
To get the permissions that you need to create a migration job for heterogeneous SQL Server migrations, ask your administrator to grant the required IAM roles on your project for the following accounts involved in the migration process:
- User account that performs the migration:
-
Database Migration Admin (
roles/datamigration.admin
)
-
Database Migration Admin (
- Database Migration Service service account:
-
Database Migration Admin (
roles/datamigration.admin
)
-
Database Migration Admin (
For more information about granting roles, see Manage access in the Identity and Access Management documentation.
These predefined roles contain the permissions required to perform heterogeneous SQL Server migrations with Database Migration Service. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to perform heterogeneous SQL Server migrations with Database Migration Service:
datamigration.*
resourcemanager.projects.get
resourcemanager.projects.list
alloydb.clusters.create
alloydb.clusters.get
alloydb.clusters.list
alloydb.clusters.update
alloydb.clusters.delete
alloydb.instances.create
alloydb.instances.get
alloydb.instances.list
alloydb.instances.update
alloydb.instances.delete
alloydb.operations.get
compute.machineTypes.list
compute.machineTypes.get
compute.projects.get
You might also be able to get these permissions with custom roles or other predefined roles.
Define settings and create a migration job
To create a migration job, perform the following steps:
- In the Google Cloud console, go to the Migration jobs page.
- Click Create migration job.
The migration job configuration wizard page opens. This wizard contains multiple panels that walk you through each configuration step.
You can pause the creation of a migration job at any point by clicking SAVE & EXIT. All of the data that you enter up to that point is saved in a draft migration job. You can finish your draft migration job later. See Update a draft migration job.
- On the Get started page, enter the following information:
- Migration job name
This is a human-readable name for your migration job. This value is displayed in the Google Cloud console.
- Migration job ID
This is a machine-readable identifier for your migration job. You use this value to work with migration jobs by using Database Migration Service Google Cloud CLI commands or API.
- From the Source database engine list, select your SQL Server source database.
- From the Destination database engine drop-down menu, select AlloyDB for PostgreSQL.
- Optional: If you want to manage your own data encryption key for the migration,
expand the Advanced encryption options and do the following:
- Select the Cloud KMS key option.
- Leave the default Cloud KMS option for the Key type setting.
Database Migration Service doesn't support the Cloud KMS with autokey feature.
- From the Select a customer-managed key drop-down menu, select your encryption key. You can also manually enter the fully qualified identifier for your key.
- Migration job name
- Click Save and continue.
- On the Define your source page, from the Source connection profile drop-down menu, select your source connection profile.
- Click Save and continue.
- On the Define a destination page, from the Destination connection profile drop-down menu, select your destination connection profile.
- Click Save and continue.
- On the Configure migration objects page, perform the following actions:
- From the Conversion workspace drop-down menu, select your conversion workspace.
- In the Select objects to migrate section, use the checkboxes to select which objects you want to include in this migration job. This list is populated based on what objects you converted to PostgreSQL schema in the conversion workspace.
- Click Save and continue.
- On the Test and create migration job, perform the following
actions:
- (Optional) Click Test job to verify if Database Migration Service
can successfully identify all the backup files and establish
the necessary network connections.
If the test fails, you can consult the error messages to address the problem, and run the test again. For more information on possible errors, see Diagnose issues.
- Click Create and start job to begin your migration.
If you want to perform the migration job at a different time, click Save and return later to run the job. See Start a migration job.
- (Optional) Click Test job to verify if Database Migration Service
can successfully identify all the backup files and establish
the necessary network connections.