How to download backup PostgreSQL database

How to download backup PostgreSQL database. As we use digital ocean so have to log in to the server with the proper login credentials. So as I have an ssh connection turned on and my configuration file is connected with the server so I can try this.

Using this command:

scp -P [port_num] [username]@[ip]:[file_path] [localFile_Path]

I set the port number and the user also IP and file path from the server and local file path where I want to download the file.
done...

Local file path example: C:\Users\shoha\Downloads

Server file path example: /var/www/db-backup/api/api-main-db-29-07-2022-.gz

This is the easiest way how you can download your Postgres database to your local drive.

0 Comments