34

I installed pgAdmin 4 as part of the postgres installer for Windows. pgAdmin is now telling me there is a newer version (4.8, > 4.5 which I have). However, there is no built in upgrade functionality that I can see, and when I went to download and run the pgAdmin 4 installer to upgrade, it installed itself in the wrong place, leading to problems.

At first I tried installing it to the default location (C:\Program Files (x86)\pgAdmin 4\v4), which was incorrect, because the previous installation (from the postgres installer) went to a different location (C:\Program Files\PostgreSQL\11\pgAdmin 4).

The second time, I pointed it to my existing install of postgres (C:\Program Files\PostgreSQL\11\pgAdmin 4), but it installed itself to a subdirectory there instead (C:\Program Files\PostgreSQL\11\pgAdmin 4\v4), rather than upgrading the existing installation, once again yielding to duplicated installations and problems arising from that. I assume if I go download the postgres installer, it will just reinstall version 4.5 of pgAdmin, though I have not tested this.

What is the correct method for upgrading a pgAdmin instance originally installed by the postgres Windows installer?

Anomaly
  • 932
  • 1
  • 10
  • 18

5 Answers5

24

I think the best option is to go to Program and files -> Select PostgreSQL and "Uninstall".

Uninstaller will ask you if you want to uninstall the whole application or only individual components. Select individual components and then select pgAdmin.

This will uninstall pgAdmin from PostgreSQL directory.

From now, install the latest version pgAdmin only from official website which will install it into: C:\Program Files (x86)\pgAdmin 4\v4

schlebe
  • 3,387
  • 5
  • 37
  • 50
Mikołaj Waśniewski
  • 1,298
  • 14
  • 16
  • 1
    I did this and it works – sutan Mar 30 '22 at 20:39
  • What is the best option ? To go to 'Program and files' !!! From where ? From FileExplorer ? From Parameters\Application ? From c:\Program Files' ? Can you be more explicit ? Thanks ? – schlebe Nov 04 '22 at 11:31
  • @schlebe: Search for "Control Panel", go to "Programs > Programs and Features" and you get the list of your installed programs. – Hollul Feb 08 '23 at 12:34
  • Or for x64 bit version (pgAdmin 4 v7.4 (released June 29, 2023)) install into: "C:\Program Files\pgAdmin 4\v7".....Worked for me. Error message disappeared. – Davor Jul 11 '23 at 20:25
11

If you Download the installer from here https://www.postgresql.org/ftp/pgadmin/pgadmin4/v4.8/windows/

It should automatically install the 4.8 version in (C:\Program Files (x86)\pgAdmin 4\v4) overwriting any existing 4.x version but keeping your server connections and setting.

In your case, the previous install was in a different place, therefore, you ended up having 2 versions.

What I suggest to you is go to control panel and uninstall from there all the versions you have. After that go to the above link, download and install the v4.8 in the default location. Every time there is a new version available just install it and let the installer install it on the default location.

Please note that your pgadmin server connections can be found in %appdata%\pgAdmin.

Note that I have personally just upgraded from v4.5 to v4.8 using this method (installing it in the default location) and it worked like a charm.

Claudio Corchez
  • 300
  • 2
  • 12
  • If the major version get updated eg: pgAdmin 4 v5 goes to pgAdmin v6, then it will create two separate installs. You need to uninstall the old one manually. – Zaffer Dec 30 '21 at 11:19
  • win11. pgadmin installer replaced old version for me, no uninstall needed i think it went from v5 to v6 but not 100% sure if it was just a minor update version – JesseBoyd Jan 13 '23 at 21:13
4

Not sure the best approach here. If you update directly pgadmin from: https://www.postgresql.org/ftp/pgadmin/pgadmin4/v4.10/windows/ the installation goes into "C:\Program Files (x86)\pgAdmin 4\v4\runtime\pgAdmin4.exe"

Wheras the installation of the whole EnterpriseDB Installer from: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads is installed here: "C:\Program Files\PostgreSQL\11\pgAdmin 4\bin\pgAdmin4.exe"

This looks like a wholly undesirable conflict? And leads to the problem identified by @Anomaly ?

IanGS
  • 41
  • 3
2

To anyone finding this post (like me), before uninstalling your current pgAdmin 4, be aware that there may be limits on compatible versions based on your version of PostgreSQL. Following the instructions by Claudio Corchez, I removed my existing pgAdmin 4 and downloaded the latest 6.15. When I attempted to install it, the installer informed me that this version was not compatible with my version of PostgreSQL 10.3. So, I headed back and downloaded 4.30, which is now running. Unfortunately, it warns me each time I run it that a newer version is available. I just need to upgrade my entire PostgreSQL installation.

guyr
  • 166
  • 1
  • 4
1

I had the same issue previously, and had to manually select the path.

Apparently now (v. 4.25) it auto-detects the path and updates correctly.

I had to download from the website, there was no update button embedded in pgAdmin itself