Reputation: 123
I need some help please, I am upgrading postgresql from v10 to v11 on Windows, but get the following error message: could not open version file: C:/Program Files/PostgresSQL/11/data/PG_VERSION
.
Here are the steps taken:
Stopped both PostgresSQL v10 and PostgresSQL v11 services using
services.msc
Set full access control/complete permissions for users for both v10 and v11.
Opened command-line and entered
RUNAS /USER:postgres "CMD.EXE
prompted to enter password for user postgres user.
New command-line window opens and cd to 'C:\Program Files\PostgreSQL\11'.
pg_upgrade.exe --old-datadir "C:/Program Files/PostgreSQL/10/data" --new-datadir "C:/Program Files/PostgreSQL/11/data" --old-bindir "C:/Program Files/PostgreSQL/10/bin" --new-bindir "C:/Program Files/PostgreSQL/11/bin" --check
On pressing enter I get the above mentioned error.
I am new to the whole process of using PostgreSQL.
Any thoughts on what is wrong?
Upvotes: 11
Views: 11472
Reputation: 869
I had to grant \postgres modify access to both the old and the new datadirectory. That solved the problem for me while upgrading from 9.6 to 10
Upvotes: 0
Reputation: 347
I had the same problem. I solved it by not running a cmd as postgres user. Instead I made a passwsord file and set the env PGPASSFILE accordingly:https://www.postgresql.org/docs/11/libpq-pgpass.html
Apparently when running cmd as postgres user, it was some permissions that prohibited the PG_VERSION to be opened
Upvotes: -1