A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/database-migration/docs/postgres/verify-migration below:

Verify a migration | Database Migration Service

Verify a migration

Stay organized with collections Save and categorize content based on your preferences.


Verifying a migration

In this page, you confirm that the migration job migrated data from your source database instance to the destination Cloud SQL database instance correctly.

At a minimum, verify that the database instance and its tables exist in the Cloud SQL instance. You can also verify the tables' row counts or exact contents.

The following steps show a minimal example:

  1. Go to the SQL Instances page in the Google Cloud console.
  2. Click the read replica entry of your migration job.
  3. Click the Activate Cloud Shell icon that appears in the upper-right region of the page.
  4. At the Cloud Shell prompt, press Enter.
  5. Optional: If an Authorize Cloud Shell dialog box appears, then click Authorize.
  6. At the Enter password prompt, enter the password that you either provided or that Database Migration Service generated for you in Define and create the destination Cloud SQL instance.
  7. Run SQL commands to verify the migration. For example:
    1. At the postgres prompt, enter \list to list the databases and verify that you see your source database instance.
    2. At the postgres prompt, enter \connect SOURCE_DB_NAME, and enter the password when prompted, to connect to the database instance and see the tables associated with the instance. The name of the prompt changes from postgres to SOURCE_DB_NAME.
    3. At the SOURCE_DB_NAME prompt, enter \dt to see the tables of this instance.
    4. At the SOURCE_DB_NAME prompt, enter GRANT cloudsqlexternalsync to USER; because you want to give this user permission to access the data in the tables of this instance. Also, replace USER with the name of the user you used to connect to the destination database instance.
    5. At the SOURCE_DB_NAME prompt, enter SELECT * from TABLE_NAME; to see the information that's replicated from a table in your source database instance.
    6. Verify that you see the correct information in the table.
  8. Verify that constraints such as primary keys, foreign keys, and indexes were migrated to the destination Cloud SQL database instance correctly.

If everything you check is as you expect, then Database Migration Service has migrated the data correctly.

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

Last updated 2025-07-09 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-09 UTC."],[[["This guide helps verify that a database migration job has correctly transferred data from a source database to a destination Cloud SQL instance."],["The basic verification process includes confirming the existence of the migrated database instance and its tables in the Cloud SQL instance."],["You can also run SQL commands through the Cloud Shell to check the row counts or exact contents of migrated tables."],["To check data integrity, one must grant specific user permissions to access table data via the cloud shell."],["Checking constraints such as primary keys, foreign keys, and indexes should also be verified in the destination database."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4