[postgis-devel] Upgrade PostGIS from 2.5.4 to 3.1.2

Sandro Santilli strk at kbt.io
Wed Jan 26 05:42:17 PST 2022


On Tue, Jan 25, 2022 at 10:58:00AM -0800, Bruce Rindahl wrote:
> Strange how this is so much easier on windows.  When I want to upgrade I
> simply install the new version of PG and PostGIS right alongside the
> existing versions. The EDB installer puts all the executables in a
> different directory, asks me where I want the data directory, and suggests
> an available port.  I then do a pg_dump of whatever database I want, pipe
> it to psql and specify the new port number.  Then I spend a while testing
> to see if everything works.  If it's good I simply shut down each instance,
> swap the port numbers in postgresql.conf and fire them up again.  Then I am
> on the new version.  Not sure if this is easily done in linux.

It is.
What you describe is what we call an "hard upgrade",
where "hard" means dump/restore is involved.

Details vary depending on the packaging system, but on debian
derivates (which means Ubuntu included) you can install multiple
combinations of postgresql and postgis on the same system, restore
dumps from old PostgreSQL versions (with old PostGIS) to new PostgreSQL
versions (with new PostGIS).

For having an EDB-installer like experience (from how you describe it)
under Linux you can use various virtualization methods (Docker, LXD,
others) and keep everything separated form the start.

--strk;


More information about the postgis-devel mailing list