G
G
GADARUKU2018-07-19 08:30:44
PostgreSQL
GADARUKU, 2018-07-19 08:30:44

How to make backups/dumps in Postgresql? What is a free and easy solution that many people use?

The base is small. On vskidku let it be 1Gb
How is it better and easier to make backups / dumps? pg_dump or pg_dump_all? In what format?
Or like this:
*What 2-3 tools are used by the majority as de-facto?*

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Melkij, 2018-07-19
@GADARUKU

Depends on backup requirements.
If you need point in time recovery, i.e. the ability to restore the state of the cluster to some arbitrary transaction - then this is pg_basebackup + WAL archive.
In order not to assemble the constructor manually, there is a barman. If you want to backup somewhere in s3, then wal-e or wal-g will be easier.
One database separately cannot be backed up and restored in this way, only the entire instance. Backup volume = the volume of the entire instance + the volume of all WALs from the start of basebackup to the desired recovery moment, the number of wal depends on your writing load.
If there are enough logical snapshots of data, for example, daily ones, then yes, pg_dump. Recovery, respectively, only at the time the dump was started.
Typically pg_dumpall -g is done to save the global cluster data - users, tablespace, database names and a separate pg_dump for those databases that need to be backed up.
The format is often custom made. it is regularly compressed and allows you to restore certain objects from the dump through pg_restore, and not just the whole thing as text through psql. For a gigabyte database, it makes no sense, but for larger databases it makes sense to make the directory format into several threads.

K
ky0, 2018-07-19
@ky0

For a database of this size, pg_dump is fine.

A
Alexander Leonchik, 2018-07-19
@AlexanderMint

We use backup.github.io/backup/v4/installation for backups, the flight is stable for several years.
I don't think this is the solution most people use. But the thing is good

D
Dmitry Shitskov, 2018-07-19
@Zarom

Barman - great tool
https://www.pgbarman.org

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question