techmatters / terraso-backend

A Django project that powers the backend of Terraso platform.
GNU Affero General Public License v3.0
21 stars 4 forks source link

build: update posgres to 16 #1547

Closed paulschreiber closed 1 week ago

paulschreiber commented 1 week ago

Description

To upgrade your local development environment With Postgres 14: ensure your backend Docker container is running (make run). Back up your database:

CONTAINER_ID=`docker ps | grep postgis | cut -c 1-12`
docker exec -it  ${CONTAINER_ID} pg_dumpall -U postgres > terraso.sql

Delete the data directory:

docker compose -f docker-compose.dev.yml down
docker volume rm backend_postgresql_data

With Postgres 16: ensure your backend Docker container is running (make run). Restore the data:

CONTAINER_ID=`docker ps | grep postgis | cut -c 1-12`
cat terraso.sql| docker exec -i ${CONTAINER_ID} psql -U postgres