Changes between Version 6 and Version 7 of UsersWikiWinUpgrade


Ignore:
Timestamp:
12/20/11 08:41:50 (13 years ago)
Author:
robe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiWinUpgrade

    v6 v7  
    4343
    4444{{{
     45== CLEAN HARD UPGRADE ON WINDOWS ==
     46General Hard upgrade instructions are documented in [http://www.postgis.org/documentation/manual-svn/postgis_installation.html#hard_upgrade PostGIS Hard Upgrade]
    4547
     48You need to do a hard upgrade if you are using a pre-alpha release of a major release such as the case with PostGIS 2.0
     49or you are upgrading from one major version to another e.g 0.*, 1.* --> 2.*
     50
     511. Create a backup of your postgis database as usual.  You can do this with pg_dump as that instructions describe or PgAdmin III by right-clicking on the database -> Backup.  Make sure to use "Custom" backup for format if you are using PgAdmin III.
     522. Create a new postgis database installed with the postgis version you want to upgrade to.  Note if you are using PostgreSQL 9.1 and PostGIS 2.0 -- you can use the new in psql or pgAdmin III sql window after you have created a new database
     53to spatially enable it.
     54
     55{{{
     56CREATE EXTENSION postgis;
     57CREATE EXTENSION postgis_topology
    4658}}}
    4759
     60
     613. If you don't have perl on your windows box, download [http://www.activestate.com/activeperl/downloads ActivePerl] and install.  You can use the 64-bit or 32-bit version even if you are using 32-bit PostgreSQL. [http://www.activestate.com/activeperl/downloads].
     62When prompted to do so, choose to add Perl to your environment path and map perl to .pl scripts.
     63
     64Note that ActivePerl also has packages for MacOS, Linux, but is generally not necessary for those platforms since they come prepackaged with perl.
     65
     664. Create an upgrade.bat file with contents something like this:
     67{{{
     68set PGPORT=5432
     69set PGHOST=localhost
     70set PGUSER=postgres
     71set PGPASSWORD=yourpasswordhere
     72set THEDB=mydb
     73set PGINSTALL=C:\Program Files (x86)\PostgreSQL\9.1
     74REM note the below example is if you are on 32-bit windows choose which install path makes most sense
     75REM set PGINSTALL=C:\Program Files\PostgreSQL\9.1\
     76set PATH=%PATH%;"%PGINSTALL%\bin\"
     77perl utils/postgis_restore.pl "mydb.backup" | psql %THEDB% 2> errors.txt
     78pause
     79}}}
     80
     815. Edit the script accordingly to your path settings.  Note that utils folder is packaged with the PostGIS tar balls
     82if not present in your PostGIS install. Download the tar ball for the PostGIS you want to upgrade too.  [http://www.postgis.org/download/]
     836. Right mouse click on the .bat file (you may have to choose -- Run as Administrator)
     847.  If all is working -- you should see a screen something like:
     85
     86{{{
     87ALTER TABLE
     88ALTER TABLE
     89SET
     90}}}