While Upgrading PostgreSQL pod, I am getting this error:
The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 13.6.
This PostgreSQL is a Deployment and has PVC attached to it.
While Upgrading PostgreSQL pod, I am getting this error:
The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 13.6.
This PostgreSQL is a Deployment and has PVC attached to it.
Hello jeetsahai,
This happened because of a conflict between the files in the volume that belongs to postgress 10 and the engine itself for postgress 11.
Solution:
1- Take a dump from the database by using:
kubectl exec -it -- <postgres-pod-name> pg_dump db_name > local.dump.sql
2- remove the PVC and recreate it.
3- upgrade your DB pods.
4- restore your database in the new version :
cat database.sql | kubectl exec -i [pod-name] -- psql -U [postgres-user] -d [database-name]
Thanks,
KodeKLoud Support