[postgis-devel] Dump/Restore etc

Sandro Santilli strk at keybit.net
Wed Dec 14 00:33:22 PST 2011


On Fri, Dec 09, 2011 at 11:10:19PM -0800, Brian Hamlin wrote:
> fpr what its worth, its strikes me that robe2's described approach
> makes good sense..
> defining a "prepare for postgis 2" script that does what might be
> needed, to a 1.5 existing db
> 
> to be completely clear
> 
>   a 2.0 dump creates a file that is ready to be 2.0 loaded
> 
>   a "prepare for 2.0" script, then dump, creates a file that is
> ready to be 2.0 loaded

Brian (and everyone else): may I ask you to test the postgis_restore script
we have in current SVN repository for your 1.5 => 2.0 (or any other)
upgrade path ?

Quick instructions:

 # 1. Dump old db
 pg_dump -Fc OLDDB > OLDDB.dump

 # 2. Create and spatially-enable new db
 #    NOTE: this step is documented elsewhere and may be
 #          easier on some setups (ie: create from template)
 createdb NEWDB
 createlang plpgsql NEWDB
 psql -f postgis/postgis.sql NEWDB
 psql -f topology/topology.sql NEWDB # if needed/desired
 psql -f raster/rt_pg/rtpostgis.sql NEWDB # if needed/desired

 # 3. Restore dump
 perl utils/postgis_restore.pl OLDDB.dump | psql NEWDB 2> errors.txt

Such process works fine on 2.0 => 2.0 and topology data in dump.
It is expected for errors.txt to be empty ...

Thanks

--strk; 

  ,------o-. 
  |   __/  |    Thank you for PostGIS-2.0 Topology !
  |  / 2.0 |    http://www.pledgebank.com/postgistopology
  `-o------'




More information about the postgis-devel mailing list