Closed renzon closed 1 year ago
Commands used to keep local db:
docker-compose up sudo cp .pgata .pgdata_old docker exec -it pythonpro_database /usr/bin/pg_dumpall -U pythonpro > dumpfile docker-compose down sudo rm -rf .pgdata
docker-compose up docker exec -i pythonpro_database psql -U pythonpro < dumpfile
sudo rm -rf .pgdata_old rm dumpfile
Commands used to keep local db:
Backup
docker-compose up sudo cp .pgata .pgdata_old docker exec -it pythonpro_database /usr/bin/pg_dumpall -U pythonpro > dumpfile docker-compose down sudo rm -rf .pgdata
Update docker compose file and load backup
docker-compose up docker exec -i pythonpro_database psql -U pythonpro < dumpfile
Verify database and clean stuff if it´s ok
sudo rm -rf .pgdata_old rm dumpfile