[postgis-users] Problem moving database
Michael A. Peters
mpeters at shastaherps.org
Fri Sep 9 14:52:09 PDT 2011
pcreso at pcreso.com wrote:
> The issue is that you are trying to install an old version of postgis
> into the new database.
>
> My normal approach (yet to fail - for me at least):
>
> create the new database
> install the appropriate/current version of Postgis in that db (this may
> require plpgsql as well as running postgis.sql & spatial_ref_sys.sql)
>
> dump the old db without the "create new db option" & copy the dump file
> to the new system
>
> run psql -d <newdb> -f <old db dump file>
> (optionally create any users you want in the new db to be compatible
> with the old db)
>
> you will still get errors as it fails to install the old postgis on top
> of the one that is already there, but that is fine - you don't want or
> need the old postgis.
>
> That should give you a working new db.
All my GIS data is from shape files, I wonder if the best approach may
be to just load them fresh rather than as part of the restore - IE dump
the database without the GIS data tables and restore that, add the
tables and load from the shape files.
More information about the postgis-users
mailing list