Azure postgres migration - tables with no primary keys

sql user 86 Reputation points
2022-01-05T11:16:48.427+00:00

Hello experts,

I want to migrate postgres v11 onpremises to azure database for postgres(single) using azure DMS. i know i have to enable logical replicaiton on the source to use azure DMS for online migration and table needs primary keys. But I have few tables with no primary key in the source database .How do i move those tables using azure DMS. ?

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Anurag Sharma 17,631 Reputation points
    2022-01-06T13:53:32.003+00:00

    Hi @sql user , welcome to Microsoft Q&A forum.

    DMS has the limitation to use primary keys on all tables to handle syncing to target database. However as a workaround we can temporarily set a primary key for the table for migration to continue. We can remove the primary key after data migration is complete. Same is mentioned in below article:

    Known issues/migration limitations with online migrations from PostgreSQL to Azure DB for PostgreSQL

    Other way is to use dump and restore method:

    Migrate your PostgreSQL database by using dump and restore

    Please let us know if this helps or else we can discuss further. If answer helps, you can mark it 'Accept Answer'.

    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.