Hello Guys, How are you all? Hope You all Are Fine. Today I am not able to access my database I am facing following error in my error log The data directory was initialized by PostgreSQL version 13 which is not compatible with this version 14.0 in docker. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
- How The data directory was initialized by PostgreSQL version 13 which is not compatible with this version 14.0 Error Occurs ?
- How To Solve The data directory was initialized by PostgreSQL version 13 which is not compatible with this version 14.0 Error ?
- Solution 1: Pull the image again
- Solution 2: Downgrade PostgreSQL version 13
- Summary
How The data directory was initialized by PostgreSQL version 13 which is not compatible with this version 14.0 Error Occurs ?
Today I am not able to access my database I am facing following error in my error log.
2021-10-08 [1] FATAL: database files are incompatible with server
2021-10-08 [1] DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 14.0 (Debian 14.0-1.pgdg110+1).
PostgreSQL Database directory appears to contain a database; Skipping initialization
How To Solve The data directory was initialized by PostgreSQL version 13 which is not compatible with this version 14.0 Error ?
- How To Solve The data directory was initialized by PostgreSQL version 13 which is not compatible with this version 14.0 Error ?
To Solve The data directory was initialized by PostgreSQL version 13 which is not compatible with this version 14.0 Error First of all you need to Remove the postgres image Then just Remove the volume Now Pull the image again Here is command that you can use.
- The data directory was initialized by PostgreSQL version 13 which is not compatible with this version 14.0
To Solve The data directory was initialized by PostgreSQL version 13 which is not compatible with this version 14.0 Error First of all you need to Remove the postgres image Then just Remove the volume Now Pull the image again Here is command that you can use.
Solution 1: Pull the image again
- First of all you need to Remove the postgres image
- Then just Remove the volume
- Now Pull the image again
Here is command that you can use.
docker kill $(docker ps -q) # stop all containers
docker rm $(docker ps -a -q) # remove all containers
docker rmi $(docker images -q) # remove all images
docker network prune # remove all networks
docker volume prune # remove all volumes
Solution 2: Downgrade PostgreSQL version 13
Just downgrade PostgreSQL to version 13
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution Sfor you?
Also, Read