pgdump to local machine

Larry Lüer 1 Reputation point
2021-07-12T11:14:15.523+00:00

Hi,
I have canceled my azure subscription and have 90 days to secure my data. I want to do a pgdump from my postges db to my local hard disk. I have found this post:

https://techcommunity.microsoft.com/t5/azure-database-support-blog/export-azure-sql-database-to-local-path/ba-p/369029

which seems utterly complex. Is there not a simpler solution? If not, why not?
Thanks, Larry

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Anurag Sharma 17,566 Reputation points
    2021-07-12T13:42:28.977+00:00

    Hi anonymous userLer-8938, welcome to Microsoft Q&A forum.

    The link that you have provided corresponds to Azure SQL Database, but I think what you are looking for is Azure Database for PostgreSQL as per your query. You can use the below article to create a dump file on your local system by connecting to Azure Postgres.

    Migrate your PostgreSQL database by using dump and restore

    I also tried using the below command and was able to create dump of database:

    pg_dump -Fc -v --host=<yourpostgresserver>.postgres.database.azure.com --username=username@xxxxxx --dbname=<yourdatabasename> -f backup.dump  
    

    I am assuming you already have PostgreSQL installed on system.

    You also need to add a firewall to connection security from the machine you are running this command from.

    Please let me know if this helps or you need more information.

    ----------

    if answer helps, you can mark it 'Accept Answer'

    0 comments No comments