Posts

Showing posts with the label Basebackup

How To Basic Basebackup in PostgreSQL

Hello, I would like to share my knowledge about how to get basebackup in PostgreSQL and with getting lots of errors and how to overcome it. So you should be ready to getting crash and doing stupid things and to be achieve! First of all, you need to make sure if your WAL archiving is enabled. You can look at Postgres.conf under cluster data file. Following steps you can connect your database as super user to continue but I'll use psql in bash. Access your environment and connect as postgres user and continue as bellow; [root@gunce]#sudo su - postgres -bash-4.2$ psql -d backup_test -c "select pg_start_backup(' backuptest ');"  pg_start_backup -----------------  0/F000028 (1 row) -bash-4.2$ tar -czf gunce.tar.gz data/* -C /var/lib/pgsql/9.6/ -bash-4.2$ psql -d  backup_test  -c "select pg_stop_backup();" NOTICE:  pg_stop_backup complete, all required WAL segments have been archived  pg_stop_backup ----------------  0/F000130 (1 row)