Create a migration job

Database Migration Service uses migration jobs to migrate data from your source database instance to the destination AlloyDB for PostgreSQL database instance.

Creating a migration job includes:

  • Defining settings for the migration job
  • Specifying information about the connection profile that you created for your source database (source connection profile)
  • Specifying information about the connection profile that you created for your destination database (destination connection profile)
  • Configuring the objects that you want to migrate from the source database
  • Testing the migration job to ensure that the connection information you provided for the job is valid

Before you begin

Before you create a migration job, make sure that you:

  • Create connection profiles for both your source Oracle database and your destination AlloyDB for PostgreSQL database. See Create connection profiles.
  • Create a conversion workspace that Database Migration Service uses to convert the schema and objects from your source database to a format that's compatible with your destination database instance. See Create a conversion workspace.

Define settings for the migration job

  1. Go to the Migration jobs page in the Google Cloud Console.
  2. Click CREATE MIGRATION JOB at the top of the page.
  3. Provide a name for the migration job. Choose a friendly name that helps you identify the migration job. Don't include sensitive or personally identifiable information in the job name.
  4. Keep the auto-generated Migration job ID.

  5. From the Source database engine menu, select Oracle.

  6. From the Destination database engine menu, select AlloyDB for PostgreSQL.

  7. Select the destination region for your migration. This is where the Database Migration Service instance is created, and should be selected based on the location of the services that need your data, such as Compute Engine instances and App Engine apps, and other services. After you choose the destination region, this selection can't be changed.

  8. Optional: Expand the Advanced encryption options section and specify whether you want to manage the encryption of the data that's migrated from the source to the destination. By default, your data is encrypted with a key that's managed by Google Cloud.

    If you want to manage your encryption, you can use a customer-managed encryption key (CMEK). The key must be in the same location as your Cloud SQL for MySQL database. For example, for databases located in us-west1 can use only keys in us-west1.

    1. Select the Customer-managed encryption key (CMEK) radio button.
    2. From the Select a customer-managed key menu, select your CMEK.

      If you don't see your key, then click ENTER KEY RESOURCE NAME to provide the resource name of the key that you want to use. For example, you can enter projects/my-project-name/locations/my-location/keyRings/my-keyring/cryptoKeys/my-key in the Key resource name field, and then click SAVE.

  9. Review the required prerequisites that are generated automatically to reflect how the environment must be prepared for a migration job. These prerequisites can include how to configure the source database and how to connect it to the destination database instance. It's best to complete these prerequisites at this step, but you can complete them at any time before you test the migration job or start it. For more information about these prerequisites, see Configure your source Oracle database.

  10. Click SAVE & CONTINUE.

Define source settings

On the Define your source page, perform the following:

  1. From the Source connection profile drop-down menu, select the source connection profile for your Oracle instance.
  2. Click Save and continue.
  3. (Optional) In the Test connection profile section, click Run test to check if Database Migration Service can establish a network connection to your source instance.

    You can create the migration job even if the connection test fails, but you should fix any connectivity issues before you run the migration job.

  4. In the Customize source configuration section, configure the following settings:
    Full dump configuration
    In this section, you can choose how to perform the full dump phase of your migration.
    • Select Automatic if you want Database Migration Service to automatically read all existing data from the databases you select for migration, and then load that data to the destination cluster for you.
    • Select Customer-managed if you want to load existing data from your source to the destination cluster outside Database Migration Service. This option causes the migration job to skip the full dump phase and immediately start with the CDC phase.

      To use the customer-managed full dump phase, you need to provide an Oracle System Change Number (SCN) to mark at which log position you want Database Migration Service to begin the change data capture replication.

    Source read settings
    You can customize how many maximum concurrent connections Database Migration Service can make to your source instance for the full dump phase or the CDC phase.

    Database Migration Service adjusts the number of connections to ensure the best performance within provided connection limit. Increasing the maximum connection limit can improve the migration speed, but introduces additional load on your source databases.

    You can configure the following settings:

    • Maximum concurrent full dump connections

      Default value: 50

      Allowed values: minimum 1, maximum 50

    • Maximum concurrent CDC connections

      Default value: 5

      Allowed values: minimum 1, maximum 50

  5. Click Save and continue.

Define destination settings

On the Define your destination page, perform the following:

  1. From the Destination connection profile drop-down menu, select the destination connection profile.
  2. Click Save and continue.
  3. (Optional) In the Test connection profile section, click Run test to check if Database Migration Service can establish a network connection to your destination.

    You can create the migration job even if the connection test fails, but you should fix any connectivity issues before you run the migration job.

  4. In the Customize destination configuration section, configure the following settings:
    Maximum concurrent destination connections

    Default value: 128

    Allowed values: minimum 2, maximum 256

    You can customize how many maximum concurrent connections Database Migration Service can make to your destination instance.

    Database Migration Service adjusts the number of connections to ensure the best performance within provided connection limit. Increasing the maximum connection limit can improve the migration speed, but introduces additional load on your destination databases.

    Transaction timeout

    Default value: 30

    Allowed values: minimum 30, maximum 300

    During the migration process, Database Migration Service can encounter certain issues that cause the transaction to time out. You can adjust the number of seconds that Database Migration Service waits for the transaction to complete before it is canceled.

    Canceled transactions don't cause your migration job to fail. The migration job continues to copy data, but moves to the Running with errors status. You can view migration job details to check what issues need to be addressed.

  5. Click Save and continue.

Select objects to migrate

  1. Select your conversion workspace from the Conversion workspace drop-down list.

  2. Optional. Click VIEW DETAILS to see additional information about the conversion workspace.

    After you select a conversion workspace, the Select objects to migrate region of the page lists all objects (schemas and tables) from the Oracle source database that can be migrated into the destination.

  3. Select the database objects from the list that you want Database Migration Service to migrate.

  4. Click SAVE & CONTINUE.

Test and create the migration job

On this final step, review the summary of the migration job settings, source, and destination, and then test the validity of the migration job setup. If any issues are encountered, then you can modify the migration job's settings. Not all settings are editable.

  1. Click TEST JOB to verify that:

    • The source database has been configured correctly, based on the prerequisites.

    • Database Migration Service can connect to the destination database.

    • All converted tables are present in the destination database.

    • All converted tables in the destination database have a primary key.

    • None of the converted tables in the destination database has a foreign key. Foreign keys don't block the migration, however they impact the overall performance of the migration. If there are tables with foreign keys in the destination database, Database Migration Service issues a warning.

    If the test fails, then you can address the problem in the appropriate part of the flow, and return to re-test.

    The migration job can be created even if the test fails, but after the job is started, it may fail at some point during the run.

  2. Click CREATE & START JOB to create the migration job and start it immediately, or click CREATE JOB to create the migration job without immediately starting it.

    If the job isn't started at the time that it's created, then it can be started from the Migration jobs page by clicking START.

    Regardless of when the migration job starts, your organization is charged for the existence of the destination instance.

  3. The migration job is added to the migration jobs list and can be viewed directly.