Sur cette page, vous confirmez que la tâche de migration a correctement migré les données de votre instance de base de données source vers l'instance de base de données AlloyDB de destination.
Vérifiez au minimum que l'instance de base de données et ses tables existent dans l'instance AlloyDB. Vous pouvez également vérifier le nombre de lignes ou le contenu exact des tableaux.
Les étapes suivantes présentent un exemple minimal:
Accédez à la page Clusters AlloyDB dans la console Google Cloud .
Cliquez sur l'entrée correspondant à l'instance dupliquée avec accès en lecture de votre job de migration.
Cliquez sur l'icône Activer Cloud Shell qui s'affiche en haut à droite de la page.
Lorsque Cloud Shell vous y invite, appuyez sur Entrée.
Facultatif: Si une boîte de dialogue Autoriser Cloud Shell s'affiche, cliquez sur Autoriser.
Exécutez des commandes SQL pour vérifier la migration. Exemple :
Lorsque l'invite postgres s'affiche, saisissez \list pour répertorier les bases de données et vérifier que votre instance de base de données source est bien affichée.
Dans l'invite postgres, saisissez \connect SOURCE_DB_NAME, puis le mot de passe lorsque vous y êtes invité pour vous connecter à l'instance de base de données et afficher les tables qui lui sont associées. Le nom de l'invite passe de postgres à SOURCE_DB_NAME.
Dans l'invite SOURCE_DB_NAME, saisissez \dt pour afficher les tables de cette instance.
Dans l'invite SOURCE_DB_NAME, saisissez GRANT alloydbexternalsync to USER; pour autoriser cet utilisateur à accéder aux données des tables de cette instance. Remplacez également USER par le nom de l'utilisateur que vous avez utilisé pour vous connecter à l'instance de base de données de destination.
Dans l'invite SOURCE_DB_NAME, saisissez SELECT * from TABLE_NAME; pour afficher les informations répliquées à partir d'une table de votre instance de base de données source.
Vérifiez que les informations qui s'affichent dans le tableau sont correctes.
Si tout ce que vous vérifiez est conforme à vos attentes, cela signifie que Database Migration Service a correctement migré les données.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/01 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/01 (UTC)."],[[["\u003cp\u003eThis guide provides steps to verify that data has been correctly migrated from a source database instance to an AlloyDB database instance.\u003c/p\u003e\n"],["\u003cp\u003eThe minimum verification involves checking for the existence of the database instance and its tables within the AlloyDB instance.\u003c/p\u003e\n"],["\u003cp\u003eUsers can verify the migration by accessing the read replica of their migration job via the Google Cloud console and executing SQL commands in Cloud Shell.\u003c/p\u003e\n"],["\u003cp\u003eThe verification process includes listing databases, connecting to the source database, viewing its tables, granting access, and selecting data from a replicated table.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful verification, evidenced by expected results, confirms that the Database Migration Service has accurately transferred the data.\u003c/p\u003e\n"]]],[],null,["# Verify a migration\n\n\u003cbr /\u003e\n\n[MySQL](/database-migration/docs/mysql/verify-migration \"View this page for the MySQL version of Database Migration Service.\") \\| [PostgreSQL](/database-migration/docs/postgres/verify-migration \"View this page for the PostgreSQL version of Database Migration Service.\") \\| PostgreSQL to AlloyDB\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nVerifying a migration\n---------------------\n\nIn this page, you confirm that the migration job migrated data from your source database instance to the destination AlloyDB database instance correctly.\n\n\u003cbr /\u003e\n\nAt a minimum, verify that the database instance and its tables exist in the\nAlloyDB instance. You can also verify the tables' row counts or exact\ncontents.\n\n\nThe following steps show a minimal example:\n\n1. Go to the [AlloyDB clusters page](https://console.cloud.google.com/alloydb) in the Google Cloud console.\n2. Click the read replica entry of your migration job.\n3. Click the **Activate Cloud Shell** icon that appears in the upper-right region of the page.\n4. At the Cloud Shell prompt, press **Enter**.\n5. Optional: If an **Authorize Cloud Shell** dialog box appears, then click **Authorize**.\n6. 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 AlloyDB instance](/database-migration/docs/postgresql-to-alloydb/create-migration-job#dest).\n7. Run SQL commands to verify the migration. For example:\n 1. At the **postgres** prompt, enter `\\list` to list the databases and verify that you see your source database instance.\n 2. At the **postgres** prompt, enter `\\connect `\u003cvar translate=\"no\"\u003eSOURCE_DB_NAME\u003c/var\u003e, 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 \u003cvar translate=\"no\"\u003eSOURCE_DB_NAME\u003c/var\u003e.\n 3. At the \u003cvar translate=\"no\"\u003eSOURCE_DB_NAME\u003c/var\u003e prompt, enter `\\dt` to see the tables of this instance.\n 4. At the \u003cvar translate=\"no\"\u003eSOURCE_DB_NAME\u003c/var\u003e prompt, enter `GRANT alloydbexternalsync to `\u003cvar translate=\"no\"\u003eUSER\u003c/var\u003e`;` because you want to give this user permission to access the data in the tables of this instance. Also, replace \u003cvar translate=\"no\"\u003eUSER\u003c/var\u003e with the name of the user you used to connect to the destination database instance.\n 5. At the \u003cvar translate=\"no\"\u003eSOURCE_DB_NAME\u003c/var\u003e prompt, enter `SELECT * from `\u003cvar translate=\"no\"\u003eTABLE_NAME\u003c/var\u003e`;` to see the information that's replicated from a table in your source database instance.\n 6. Verify that you see the correct information in the table.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nIf everything you check is as you expect, then Database Migration Service has migrated the data correctly."]]