Changes between Version 1 and Version 2 of UsersWikiWinUpgrade


Ignore:
Timestamp:
Dec 20, 2011, 8:35:50 AM (13 years ago)
Author:
robe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiWinUpgrade

    v1 v2  
    55or you are upgrading from one major version to another e.g 0.*, 1.* --> 2.*
    66
    7 * 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].
    8 When prompted to do so, choose to add Perl to your environment path and map to .pl scripts.
     71. 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.
     82. 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
     9to spatially enable it.
     10
     11{{{
     12CREATE EXTENSION postgis;
     13CREATE EXTENSION postgis_topology
     14}}}
     15
     16
     173. 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].
     18When prompted to do so, choose to add Perl to your environment path and map perl to .pl scripts.
    919
    1020Note that ActivePerl also has packages for MacOS, Linux, but is generally not necessary for those platforms since they come prepackaged with perl.
    1121
    12 * Create an upgrade.bat file with contents something like this:
     224. Create an upgrade.bat file with contents something like this:
    1323{{{
    14 set PGPORT=5433
     24set PGPORT=5432
    1525set PGHOST=localhost
    1626set PGUSER=postgres
    1727set PGPASSWORD=yourpasswordhere
    18 set THEDB=dnddts20
     28set THEDB=mydb
    1929set PGINSTALL=C:\Program Files (x86)\PostgreSQL\9.1
    2030REM note the below example is if you are on 32-bit windows choose which install path makes most sense
    2131REM set PGINSTALL=C:\Program Files\PostgreSQL\9.1\
    22 set PGADMIN=%PGINSTALL%\pgAdmin III
    23 set PGBIN=%PGINSTALL%\bin\
    24 set PGLIB=%PGINSTALL%\lib\
    25 set POSTGISVER=2.0
    2632set PATH=%PATH%;"%PGINSTALL%\bin\"
    27 perl utils/postgis_restore.pl "dnddts_daily.backup" | psql %THEDB% 2> errors.txt
     33perl utils/postgis_restore.pl "mydb.backup" | psql %THEDB% 2> errors.txt
    2834pause
    2935}}}
    3036
    31 * Right mouse click on the .bat file (you may have to choose -- Run as Administrator)
     375. Edit the script accordingly to your path settings.  Note that utils folder is packaged with the PostGIS tar balls
     38if not present in your PostGIS install. Download the tar ball for the PostGIS you want to upgrade too.  [http://www.postgis.org/download/]
     396. Right mouse click on the .bat file (you may have to choose -- Run as Administrator)
     407.  If all is working -- you should see a screen something like:
     41
     42{{{
     43
     44}}}
     45