2024年6月8日星期六

postgres verup 13.4 to 14.11

Postgres  running in Docker container
--------------------------------------------

#shell
olddb=postgres1340
newdb=postgres-new-14.11

#backup old db data
docker exec -t $olddb pg_dumpall -c -U postgres > ./backup/all_db_backup.sql

#stop old db
docker stop $olddb 

#restore data to newdb
cat ./backup/all_db_backup.sql | docker exec -i $newdb psql -U postgres | tee  restore.log


Can't connect to new PostgresDB after verup
------------------------------------------------------

check /var/lib/postgresql/data/pg_hba.conf ,add :
# Allow all IPv4 connections
host all all 0.0.0.0/0 md5



没有评论: