BartlomiejSkwira
4/3/2018 - 1:02 PM

backup docker postgres

Backup and restore postgres in Docker

#Backup your databases
docker exec -u <your_postgres_user> <postgres_container_name> pg_dump -Fc <db_name> > db.dump
 
#Restore your databases
docker exec -i -u <your_postgres_user> <postgres_container_name> pg_restore -C -d <db_name> < db.dump