azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

Role migration command does not work

Open wilsonhipolito opened this issue 2 years ago • 2 comments

When trying to dump the roles as suggested by the documentation using the command below, Postgres (I am using a PostgreSQL flexible server) throws a permission error for the table pg_authid. I also tried adding --role=azure_pg_admin but it also doesn't work.

Broken command:

pg_dumpall -r --host=mySourceServer --port=5432 --username=myUser --database=mySourceDB > roles.sql

Screenshot of the error: Screenshot from 2023-02-09 19-19-55


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

wilsonhipolito avatar Feb 09 '23 18:02 wilsonhipolito

@wilsonhipolito Thank you for your feedback. We are looking into this and will let you know.

Oury-MSFT avatar Feb 09 '23 19:02 Oury-MSFT

wilsonhipolito I have tried the same but not able to connect. image @AwdotiaRomanowna any input on this ?

Oury-MSFT avatar Feb 14 '23 18:02 Oury-MSFT

Hi @wilsonhipolito, thank you for the feedback, indeed in Flexible server access to pg_authid table has been revoked from end users. You will be able to dump roles names only (without passwords). Please add --no-role-passwords option to your pg_dumpall command, like that: pg_dumpall -r --no-role-passwords --host=mySourceServer --port=5432 --username=myUser --database=mySourceDB > roles.sql

I updated the documentation, should be live soon.

@Oury-MSFT please read your error message - you have not specified the database name so psql is trying to connect to database that does not exist. This is simply user error

AwdotiaRomanowna avatar Feb 16 '23 14:02 AwdotiaRomanowna

Please close this one, all the changes are in the docs

AwdotiaRomanowna avatar Feb 28 '23 13:02 AwdotiaRomanowna

Awesome, thanks @AwdotiaRomanowna

wilsonhipolito avatar Feb 28 '23 17:02 wilsonhipolito