Sorry Brian, but I'm not sure what that means. There are a few scripts in the postgis 2 contrib directory. Do I just run them like I've been running the above commands e.g. psql -d yourdatabase -f postgis.sql
Essentially, yes. See here: http://postgis.net/docs/postgis_installation.html#hard_upgrade
I am not completely clear on your upgrade path, but this is how I did a recent upgrade:
1. Untarred postgis
2. Ran configure with --with-geoconfig and --with-projdir set
3. Moved the old postgis install to new name
4. Make postgis
5. Make install DESTDIR=/opt/postgis
6. Changed ownership of my postgis build directory and share/pgsql directory to postgres:users
7. Modified the postgis-version/utils/postgis_restore.pl to remove the portion where the database is created
8. Backed up my existing database
a. pg_dumpall -h localhost -p 5432 -U <username> -globals-only > globals.sql
b. pg_dump -d -Fc <database name> > /tmp/<dumpname>.dmp
c. pg_dump <database name> -t <special table you want to dump – this is optional> > /tmp/<table>.sql (optional – used for testing upon restore)
9. Login as postgres user
10. $ psql
11. postgres=# drop database <database name>;
12. DROP DATABASE
13. postgres=# \q
14. $ psql -U postgres –d postgres –f globals.sql (may not be needed but I did it anyways because I upgraded the DB too)
15. $ createdb -U <username>
16. $ createdb -U <username> database
17. $ createlang -U postgres plpgsql -d database
18. $ psql -U postgres -f postgis.sql -d database
19. $ psql -U postgres -f spatial_ref_sys.sql -d database
20. $ sh share/pgsql/contrib/utils/postgis_restore.pl <upgrade sql script under contrib> <database name> <dump file name> &> restore.log
21. Finally after examing for any errors:
22. psql -c ‘select postgis_full_version();’ -d <database name>
23. And finally, run some tests. For instance, I had a non-postgis table that I dumped again and diff’d with my original dump. Or you can execute an ST_Extent on a geolocation.. up to you
Also, I had to modify the postgis.sql to point to the proper location of my postgis install, so I executed:
$ sed –i “s/\$libdir/\/opt\/postgis\/lib64\/pgsql/g” postgis.sql
It didn’t know what $libdir was so I had to tell it.
From: Wilkins, Brian
Sent: Tuesday, August 06, 2013 2:05 PM
To: 'PostGIS Users Discussion'
However it says that Topology and Raster support are not present. So I
thought that I could now run the following commands to install those
too:
<snip>
psql:/usr/pgsql-9.0/share/contrib/postgis-2.0/rtpostgis.sql:48: ERROR:
could not load library "/usr/pgsql-9.0/lib/rtpostgis-2.0.so":
libgeos-3.2.0.so: cannot open shared object file: No such file or
directory
Any idea why there is still mention of libgeos-3.2.0 ? I thought I'd
sorted that out now?
Could rtpostgis-2.0.so be a pg-routing binary? I noticed two of your copies of GEOS are in subdirectories of /depot/shared/pgrouting/. Maybe the routing binary is still linked to the old GEOS.
To be honest Brian I'm not quite sure what legacy.sql did. It is
listed here though, and it's not something I'd noticed before so
thought it was worth a go!
http://postgis.net/docs/manual-dev/postgis_installation.html#create_new_db