Opened 13 years ago

Closed 13 years ago

#1367 closed task (fixed)

Provide a clear upgrade path to 2.0

Reported by: strk Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: master
Keywords: Cc:

Description

We need a way to upgrade an existing spatial database to 2.0 w/out having to ignore errors here and there.

Ideally a script could take care of it all, but first thing is defining the process steps.

Attachments (1)

import_report16dec11.txt (4.5 KB ) - added by darkblueb 13 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by strk, 13 years ago

My current idea is:

  1. pg_dump -Fc > old.dump
  2. createdb newdb && spatially enable it
  3. utils/new_postgis_restore.pl old.dump | psql newdb

I've been working on making this model work. Can you see conceptual issues with it ?

comment:2 by strk, 13 years ago

By the end of the process above I end up with some tables using geometry column constraints and some tables using typmod. We may need a step 4. to perform the cleanup/conversion or embed that part directly into step 3. (postgis_restore phase). Splitting would help debugging and be probably safer.

by darkblueb, 13 years ago

Attachment: import_report16dec11.txt added

comment:3 by darkblueb, 13 years ago

I have now tried this once on a non-trivial database. It appears to succeed.

source database ⇒ POSTGIS="1.5.3" GEOS="3.2.2-CAPI-1.6.2" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.7" USE_STATS

destination database, trunk rev 8447 ⇒ POSTGIS="2.0.0SVN" GEOS="3.4.0dev-CAPI-1.8.0" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.6" USE_STATS

comment:4 by strk, 13 years ago

darkblueb: which PostgreSQL versions for the two above upgrades ?

comment:5 by darkblueb, 13 years ago

destination postgresl 9.1.1 source postgresql 9.1b3

comment:6 by strk, 13 years ago

With r8468 the postgis_restore.pl script also takes care of spatial_ref_sys by restoring all entries in dump with SRIDs not found in pre-existing spatial_ref_sys table, thus allowing you to decide which version of the core srid you want (you probably want the new ones).

This means that step 2 in the first comment (spatially-enable new database) could now include sourcing spatial_ref_sys.sql w/out worrying about getting a zilion "duplicate primary key" errors at restore time.

I guess all is left here is documenting the procedure and calling for test.

comment:7 by strk, 13 years ago

Resolution: fixed
Status: newclosed

r8469 documents the procedure in the existing HARD UPGRADE section of the PostGIS manual. Any left over I would call a bug, thus worth a separate ticket. Thanks for testing!

Note: See TracTickets for help on using tickets.