SPAM: [postgis-users] need restore assistance

Josh Livni josh at umbrellaconsulting.com
Mon Dec 10 13:27:07 PST 2007


Kirk,

Of course I'm not sure how your database was backed up, but chances are 
you can get your data back somehow.

I would first try a few things - if one in particular fails, it may help 
others isolate the trouble if you can give specific errors it failed 
with.  The command examples in parenthesis are from command line:
 - create brand new new database for the restore
 - ensure the database has plpgsql -- (createlang plpgsql <database>)
 - ensure spatial_ref_sys and geometry_columns tables do _not_ exist in 
the new database (in case they were in your template; drop them if 
necessary)
 - run lwpostgis.sql -- (psql -f /usr/share/lwpostgis.sql -d <database>) 
and make sure it runs fine
 - add spatial ref columns -- (psql -f /usr/share/lwpostgis_upgrade.sql 
-d <database>)
 - try restore --  (pg_restore -C -d <database> )

  -Josh



Kirk Wythers wrote:
> I set up a new machine and am trying to do a restore from a
> pg_dumpall. First question, is this possible. I noticed after running
> the command:
>
> psql 'file_to_restore' postgres
>
> that for the most part, all of the databases get restored, however, tables
> that contain spatial info (such as the_geom) are missing from their
> respective databases.
>
> I was reading the documentation and see a reference to a "Hard 
> Restore" using
>
> sh utils/postgis_restore.pl lwpostgis.sql newdb olddb.dump -E=UNICODE
> > restore.log
>
> But I can't find postgis_restore.pl on my system. 
>
> Additionally, I am concerned
> that the pg_dumpall may not have bee done with -Fc. Can a pg_dumpall
> be restored if it contains spatial info from postgis?
>
> It looks like I am about to learn the hard way how to do a proper
> postgis backup, and that the postgresql procedures I am used to, may
> not be sufficient.
>
> Thanks for any advice that might help me get this db back up
>
> Kirk
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   



More information about the postgis-users mailing list