[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Diagnose issues in PostgreSQL to AlloyDB migrations\n\nTroubleshoot migration errors\n-----------------------------\n\nThe migration job process might incur errors during runtime.\n\n- Some errors, such as a bad password on the source database, are recoverable, meaning they can be fixed and the migration job resumes automatically.\n- Some are unrecoverable, such as errors in data replication, meaning the migration job needs to be restarted from the beginning.\n\nWhen an error occurs, the migration job status changes to `Failed`, and the substatus reflects the last status before failure.\n\nTo troubleshoot an error, navigate to the failed migration job to view the error and follow the steps outlined in the error message.\n\nTo view more details about the error, navigate to Cloud Monitoring using the link on the migration job. The logs are filtered to the specific migration job.\n\nIn the following table, you can find some examples of issues and how they can be solved:\n\n\n### Clean up replication slots\n\nYou see one of the following messages:\n\n- `Cleanup may have failed on source due to error: generic::unknown: failed to connect to on-premises database.`\n- `Error promoting EM replica: finished drop replication with errors.`\n\n\u003cbr /\u003e\n\n#### Possible causes\n\nWhen promoting a AlloyDB instance, if the source instance isn't reachable from the AlloyDB instance (for example, the source instance isn't running, or you removed the AlloyDB instance from the allow list of source instances), then the settings needed for the replication can't be cleaned up during the promotion of a migration job. You must clean up the replication slots manually.\n\n#### Things to try\n\nFor each database, run the following commands as a user with the `superuser` privilege:\n\n1. Get the replication slot names from the error message, and then run the following command to drop the slots, one by one:\n\n ```\n select pg_drop_replication_slot({slot_name});\n ```\n2. If the replication slot names aren't available in the error message, then run the following command to query for the existing replication slots:\n\n ```\n select pg_drop_replication_slot(slot_name) from pg_replication_slots where slot_name like '%alloydb%' and active = 'f';\n ```\n3. If there are no AlloyDB replicas using the source instance, then run the following command to clean up `pglogical` settings:\n\n select pglogical.drop_node(node_name) from pglogical.node where node_name like 'alloydb';\n\n4. If the `pglogical` extension isn't needed anymore, then run the following command to uninstall the extension:\n\n ```\n DROP EXTENSION IF EXISTS pglogical;\n ```\n\n\u003cbr /\u003e\n\n\n### Delete orphaned AlloyDB clusters in bootstrapping mode\n\n\u003cbr /\u003e\n\nIn rare edge cases, you might find that your migration job has been deleted, while the associated AlloyDB cluster hasn't, and is still in the bootstrapping mode. It is possible to delete the cluster using [AlloyDB's gcloud command for deleting a cluster](/alloydb/docs/cluster-delete#procedure), combined with the `--force` option.\n\nNote that deleting a bootstrapping cluster while it's being used by a migration job results in undefined behavior.\n\n\n### Manage users and roles\n\n\u003cbr /\u003e\n\n#### Migrate existing users\n\nCurrently, Database Migration Service doesn't support migrating existing users from a source instance into a destination AlloyDB instance. You can manage this migration by [creating the users in AlloyDB](/alloydb/docs/database-users/about) manually.\n\n#### About the `alloydbexternalsync` user\n\nDuring the migration, all objects on the AlloyDB primary are owned by the `alloydbexternalsync` user. After the data is migrated, you can modify the ownership of the objects to other users by completing the following steps:\n\n- Run the `GRANT alloydbexternalsync to `\u003cvar translate=\"no\"\u003e{USER}\u003c/var\u003e command.\n- On each database, run the `reassign owned by alloydbexternalsync to `\u003cvar translate=\"no\"\u003e{USER}\u003c/var\u003e`;` command.\n- To remove the `alloydbexternalsync` user, run the `drop role alloydbexternalsync` command."]]