[postgis-users] Problem moving database

Sveen Atle Frenvik (Geomatikk IKT) Atle.Frenvik.Sveen at geomatikk.no
Wed Sep 14 05:08:03 PDT 2011


You might want to have a look at this blog post, which explains the 
problem, and gives the solution

http://blog.cleverelephant.ca/2010/09/postgis-back-up-restore.html

short version: do not store your data in the public schema, and only 
dump and restore your data-schema.

-atle


On 2011-09-09 23:52, Michael A. Peters wrote:
> 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.
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


-- 
Atle Frenvik Sveen
Utvikler
Geomatikk IKT AS
tlf: 45 27 86 89
atle.frenvik.sveen at geomatikk.no



More information about the postgis-users mailing list