8
votes

I'm trying to backup a local database in my laptop (PostGresSQL 9.6 ,PgAdmin3) and I see the following error.

pg_dump: server version: 9.6.3; pg_dump version: 9.5.5 pg_dump: aborting because of server version mismatch

I've tried some answers on SO, like updating the postgres on homebrew but it threw an error as well.

Error: postgres not installed

When I checked the contents of postgres application package, I found 2 folders in the versions folder, 9.5 and 9.6. I tried running the pg_dump in the bin folder of both the versions and all I see is this error:

enter image description here

Can someone help me to solve this problem and make a backup of my database

2

2 Answers

1
votes

If using brew on MacOS brew install postgresql@8.4.4 Homebrew install specific version of formula?

Stop postgres

brew services stop postgresql

Upgrade with Homebrew

brew update
brew upgrade postgresql

Check Version:

psql --version
> psql (PostgreSQL) 10.3
0
votes

I found this one more helpful than above. It has upgraded the DB without any issue. https://quaran.to/Upgrade-PostgreSQL-from-12-to-13-with-Homebrew

brew services stop postgresql
brew postgresql-upgrade-database
brew services start postgresql