1

I inherited an old server (Ubuntu 12.04.5) with a database running on PostgreSQL 8.3.8 with the PostGIS 1.3.5 Extension. This server is going to be replaced by a new server (4.14.12-1-ARCH) where I use docker to separate different PostgreSQL instances. For a first test run I used the mdillon/postgis:latest image to create the new setup. That should result in PostgreSQL 10.1 + PostGIS 2.4.

When I try to restore a dump of the old database on the new server I get a lot of errors like the following:

...
pg_restore: creating FUNCTION "public.st_box2d_in(cstring)"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 626; 1255 1052513 FUNCTION st_box2d_in(cstring) postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  could not access file "/usr/lib/postgresql/8.3/lib/liblwgeom": No such file or directory
    Command was: CREATE FUNCTION st_box2d_in(cstring) RETURNS box2d
    LANGUAGE c IMMUTABLE STRICT
    AS '/usr/lib/postgresql/8.3/lib/liblwgeom', 'BOX2DFLOAT4_in';
pg_restore: creating FUNCTION "public.st_box2d_out(box2d)"
pg_restore: [archiver (db)] Error from TOC entry 628; 1255 1052515 FUNCTION st_box2d_out(box2d) postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  could not access file "/usr/lib/postgresql/8.3/lib/liblwgeom": No such file or directory
    Command was: CREATE FUNCTION st_box2d_out(box2d) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '/usr/lib/postgresql/8.3/lib/liblwgeom', 'BOX2DFLOAT4_out';
pg_restore: creating TYPE "public.box2d"
pg_restore: [archiver (db)] Error from TOC entry 2331; 1247 1052511 TYPE box2d postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  function st_box2d_in(cstring) does not exist
    Command was: CREATE TYPE box2d (
    INTERNALLENGTH = 16,
    INPUT = st_box2d_in,
    OUTPUT = st_box2d_out,
    ALIGNMENT = int4,
    STORAGE = plain
);
...

The old database needs libraries that are not available anymore with the new Postgres-Postgis version. What's the best way to deal with this?

As I'm using docker I could maybe just create a container with the old software and keep it running without touching the database. The database is only used internally: No security problem here. On the other hand I would like to use the new Postgres-Postgis versions to be better prepared for the future. But is it realistically possible to perform an update of the database and its features?

What's the best way to deal with this?

3

0

You must log in to answer this question.

Browse other questions tagged .