Skip to content

Instantly share code, notes, and snippets.

@luc0
Last active September 10, 2020 12:58
Show Gist options
  • Save luc0/6232ece2ef705b987171b20f9f7bc41e to your computer and use it in GitHub Desktop.
Save luc0/6232ece2ef705b987171b20f9f7bc41e to your computer and use it in GitHub Desktop.

Exportar (Schema + data)

docker-compose exec db pg_dump -U fiter --inserts fiter > database-full.sql (puede ser que no te deje desde afuera y tenga que hacer desde dentro)

Copiar archivo de docker hacia afuera: docker cp db:database-full.sql backup_full.sql

Importar

Copiar archivo dentro del continaer de la db

docker cp backup.sql fiter_db_1:/tmp/b.sql

Entrar al container e importar

su postgres

psql -d fiter -U fiter < /tmp/backup.sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment