[postgis-users] Migrating part of database (At schema or table level) between two version of postgis.

Sandro Santilli strk at kbt.io
Thu Oct 19 10:43:46 PDT 2017

On Thu, Oct 19, 2017 at 10:21:46AM -0700, Hemant Bist wrote:
> We  have an old database (postgis 2.1.2/postgresql-9.3/ubuntu 14.04), and a
> new database (postgis 2.4.0,postgresql-9.5,ubuntu 16.04). Old database was
> created via Hard Upgrade
> <https://postgis.net/docs/postgis_installation.html#hard_upgrade> Although
> both dbs have spatial tables in public schema, the data I want to copy over
> is in their own schemas.
> Can I do the following?
> 1) Copy data for a schema/tables  from old db to new db?
> 2) Copy data for a schema /tables from new db to old db? NOT sure what the
> caveats here would be.

If your data is in a *different* schema from the postgis
functions/objects it should be straight-forward to move them around
(pg_dump/pg_restore). If postgis is in the same schema as the data
you'll need postgis_restore.pl instead of pg_restore. In both cases
you can restrict the pg_dump to the schema of interest.


More information about the postgis-users mailing list