Create a conversion workspace and convert schema

This page shows you how to create a conversion workspace and use it to immediately perform deterministic code and schema conversion from SQL Server to PostgreSQL. Before you create the workspace, make sure that you create a connection profile for your source database.

When you create a conversion workspace, you can upgrade it to access Gemini auto-conversion. Upgrading the workspace is possible only once, immediately after you open the newly created conversion workspace. This operation is described as the last step in this procedure.

Required roles

To get the permissions that you need to create a conversion workspace, ask your administrator to grant you the Database Migration Admin (roles/datamigration.admin) IAM role on your project.

For more information about granting roles, see Manage access in the Identity and Access Management documentation.

This predefined role contains the permissions required to create a conversion workspace in Database Migration Service. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to create a conversion workspace in Database Migration Service:

  • cloudaicompanion.entitlements.get

    This permission is included in the roles/datamigration.admin role. It is required for the Gemini-enhanced conversion features.

  • datamigration.conversionworkspaces.apply
  • datamigration.conversionworkspaces.commit
  • datamigration.conversionworkspaces.convert
  • datamigration.conversionworkspaces.create
  • datamigration.conversionworkspaces.delete
  • datamigration.conversionworkspaces.get
  • datamigration.conversionworkspaces.getIamPolicy
  • datamigration.conversionworkspaces.list
  • datamigration.conversionworkspaces.rollback
  • datamigration.conversionworkspaces.seed
  • datamigration.conversionworkspaces.setIamPolicy
  • datamigration.conversionworkspaces.update

You might also be able to get these permissions with custom roles or other predefined roles.

Create a conversion workspace

To create a conversion workspace and perform the schema conversion, do the following:

  1. In the Google Cloud console, go to Conversion workspaces.

    Go to Conversion workspaces

  2. Click Set up workspace.
  3. On the Create a conversion workspace page, do the following:
    1. Enter the name, identifier, and region for your conversion workspace.
    2. From the Source database engine drop-down menu, select your source SQL Server database.
    3. From the Destination database engine select AlloyDB for PostgreSQL.
    4. Click Create workspace and continue.
  4. On the Define source and pull schema snapshot page, do the following:
    1. From the Source connection profile drop-down menu, select the connection profile for your source database.
    2. Click Pull schema snapshot and continue.

    Database Migration Service is now connecting to the source database and retrieving your schema. This process can take several minutes.

  5. On the Select and convert objects page, use the checkboxes to select which objects you want to convert to PostgreSQL syntax.

    You don't have to convert all your objects in one go. Instead, you can select just a few objects now and add more objects to the conversion later.

  6. Click Convert and continue.

    The conversion workspace opens.

  7. When you open a new workspace for the first time, you can upgrade it to access the Gemini-powered auto-conversion feature. Do the following:
    • In the Introducing Gemini auto-conversion dialog, select the Upgrade workspace to explore the new experience checkbox, and click Continue.
    • In the Convert source objects with Gemini? dialog, click Convert.

      Database Migration Service now performs the conversion process again to apply Gemini-powered conversion enhancements on top of the deterministic conversion results. For more information on Gemini auto-conversion feature, see Gemini auto-conversion.

What's next

You can now work with your conversion workspace to fix conversion issues, modify your objects with the interactive editor, and apply converted schema to your destination database. See Convert SQL Server code and schema to PostgreSQL syntax.