Unknown error occurred on migrate azure postgres single server to azure postgre flexible server

njnjkkl 20 Reputation points
2024-12-31T03:15:31.8233333+00:00

I follow the online migration set up to migrate the single server from version 10.0 to flexble server version 11.0.But after passing the the validation the migration was failed.This is the error log.

pgcopydb failed with unknown errors. Please contact Microsoft support. Logs from the migration: 2024-12-31 02:53:18.702 62 ERROR pgcmd.c:640 Failed to run vacuumdb: exit code 1 2024-12-31 02:53:18.702 62 ERROR copydb_schema.c:666 Failed to vacuum analyze source database, see above for details

Azure Database Migration service
Azure Database for PostgreSQL
0 comments No comments
{count} votes

Accepted answer
  1. Shikha Ghildiyal 1,855 Reputation points Microsoft Employee
    2024-12-31T05:17:14.33+00:00

    Hi njnjkkl ,

    Thanks for reaching out to Microsoft Q&A.

    There are some restrictions for online migration please check the doc here. https://www.postgresql.org/docs/current/logical-replication-restrictions.html

    pgcopydb, the underlying program, might not be able to handle double-quoted entities. Please make sure to enable quote_all_identifiers and try again**.**

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Vijayalaxmi Kattimani 905 Reputation points Microsoft Vendor
    2024-12-31T05:20:50.7633333+00:00

    Hi @njnjkkl,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    We apologize for the inconvenience caused to you.

    We would like to inform you that, online migration makes use of pgcopydb follow, and some of the logical decoding restrictions apply. We also recommend that you have a primary key in all the tables of a database that's undergoing online migration. If a primary key is absent, the deficiency results in only insert operations being reflected during migration, excluding updates or deletes. Add a temporary primary key to the relevant tables before you proceed with the online migration.

    Note: In the case of online migration of tables without a primary key, only insert operations are replayed on the target. This can potentially introduce inconsistency in the database if records that are updated or deleted on the source don't reflect on the target.

    An alternative is to use the ALTER TABLE command where the action is REPLICA IDENTIY with the FULL option. The FULL option records the old values of all columns in the row so that even in the absence of a primary key, all CRUD operations are reflected on the target during the online migration. If none of these options work, perform an offline migration as an alternative.

    Note: For online migration with Azure Database for PostgreSQL single server, the Azure replication support is set to logical under the replication settings of the single server page in the Azure portal. And also, Change the password_encryption server parameter on your flexible server from SCRAM-SHA-256 to MD5 before initiating the migration. This is essential for the existing credentials on single server to work on your flexible server.

    Here are the links of some parallel threads that might help you:

    https://zcusa.951200.xyz/en-us/answers/questions/1607293/error-during-online-migration-of-postgres-single-s

    Please refer to the below mentioned links for more information.

    https://zcusa.951200.xyz/en-us/azure/postgresql/migrate/migration-service/best-practices-migration-service-postgresql#online-migration

    https://pgcopydb.readthedocs.io/en/latest/ref/pgcopydb_follow.html#pgcopydb-follow

    https://www.postgresql.org/docs/current/logical-replication-restrictions.html

    https://zcusa.951200.xyz/en-us/azure/postgresql/migrate/whats-happening-to-postgresql-single-server#migrate-from-azure-database-for-postgresql-single-server-to-azure-database-for-postgresql-flexible-server

    I hope, This response will address your query and helped you to overcome on your challenges.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.