Link to home
Start Free TrialLog in
Avatar of Luis Rodriguez-Galvan
Luis Rodriguez-GalvanFlag for Mexico

asked on

How to backup a postgress database

I have software installed in a Debian-Linux AWS EC2 instance with a PostgreSQL Database.
I need to upgrade the software and the instructions says that to upgrade I have to make a new installation and copy the PostgreSQL database from the older installation to the new installation.
Please advise which are the PostgreSQL files I need to copy.

Thanks
Luis R
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can also do file backup to DB. Read it below
https://www.postgresql.org/docs/9.1/backup-file.html



If data is small, use @noci's approach.

If data is large, better to stop your database, then build a tarball of the entire PostgreSQL data store (directory where raw data files live).

You can determine this setting using a command similar to...

sudo -u postgres psql -c "show data_directory;"

Open in new window