Verify a migration

This page describes how to confirm that your migrated data is complete andaccurate. At a minimum, you should run SQL statements to verify that your tablesexist in the migrated Cloud SQL database. For a more precisedata comparison between the source and destination database,you cantry using the open-source Data Validation Tool.

Verify destination data with SQL statements

You can run SQL statements to verify that your tablesexist in the migrated Cloud SQL database. Do the following:

  1. Connect to your Cloud SQL for SQL Server instance with a tool where you can run SQL commands against your migrated databases.

    For more information on connecting to Cloud SQL instances, seeConnection options in Cloud SQL documentation.

  2. Run SQL commands to verify your migrated data. For example:

    List all tables in a database

    Run the following commands to check if your migrated database contains all the necessary tables:

    1. Start using a specific database:
      USEDATABASE_NAME;GO
    2. List all tables in the database:
      SELECT*FROMinformation_schema.tables;

    Check table content and definitions

    Run the following commands to verify the correctness of a specific migrated table:

    1. Start using a specific database:
      USEDATABASE_NAME;GO
    2. View the table definition:
      EXECsp_help'dbo.TABLE_NAME';
    3. Verify the table contents:
      SELECT*FROMTABLE_NAME';GO

Verify data with the Data Validation Tool

Theopen-source Data Validation Tool lets you perform very precisedata comparisons between two databases, but it requires creating networkconnections to your source and destination databases.

The following steps show a minimal example:

  1. Deploy or use a virtual machine with access to both the source and the destination.

  2. In the virtual machine, create a folder in which to install the Data Validation Tool.

  3. Navigate to this folder.

  4. Usepip to install the Data Validation Tool.

    pip install google-pso-data-validator
  5. Create connections to the source SQL Server database and thedestination Cloud SQL database.

    data-validation connections add -cSOURCE_CONNECTION_NAME MSSQL --host 'ip-address' --portport --userusername --password pswd --databasedatabase-namedata-validation connections add -cTARGET_CONNECTION_NAME Postgres --host 'ip-address' --portport --userusername --password pswd --databasedatabase-name

    For example:

    data-validation connections add -c source_connection_name MSSQL --host '10.10.10.11' --port 1521 --user system --password pswd --database XEdata-validation connections add -c target_connection_name Postgres --host '10.10.10.12' --port 5432 --user postgres --password pswd --database postgres
  6. Create or generate a list of tables to compare data between the source and destination databases.

    export TABLES_LIST=$(data-validation find-tables --source-connSOURCE_CONNECTION_NAME --target-connTARGET_CONNECTION_NAME --allowed-schemasschema-name)

    For example:

    export TABLES_LIST=$(data-validation find-tables --source-conn source_connection_name --target-conn target_connection_name --allowed-schemas public)
  7. Run full validation against all tables.

    data-validation validate column --source-conn source_connection_name --target-conn target_connection_name --tables-list "${TABLES_LIST}"

We suggest that you run this validation during replication to ensure relativeconsistency. Large table queries may take too long to run during a small promotionwindow. In such cases, use the Data Validation Tool to add filters to reduceruntime or prepare the table list to include a subset of tables for the finalvalidation.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.