Restore container base with Postgres

Asked

Viewed 132 times

1

I am using a container with postgres on an EC2 server and want to restore a base in this container via linux command. Any tips?

I was trying this way:

sudo docker exec -t postgres_94 pg_restore -c -U postgres > minha_base.backup

1 answer

1

I was able to solve by running command through Docker-Compose:

sudo docker exec -i app_postgres_94_1 pg_restore --host localhost --port 5432 --username "postgres" --dbname "database_name" --verbose < ~/minha_base.backup
  • I needed this, thank you! Mark your answer as the right one > http://answall.com/help/accepted-answer

Browser other questions tagged

You are not signed in. Login or sign up in order to post.