| 1 | == CLEAN HARD UPGRADE ON WINDOWS == |
| 2 | General Hard upgrade instructions are documented in [http://www.postgis.org/documentation/manual-svn/postgis_installation.html#hard_upgrade PostGIS Hard Upgrade] |
| 3 | |
| 4 | You 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 |
| 5 | or you are upgrading from one major version to another e.g 0.*, 1.* --> 2.* |
| 6 | |
| 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. |
| 9 | |
| 10 | Note that ActivePerl also has packages for MacOS, Linux, but is generally not necessary for those platforms since they come prepackaged with perl. |
| 11 | |
| 12 | * Create an upgrade.bat file with contents something like this: |
| 13 | {{{ |
| 14 | set PGPORT=5433 |
| 15 | set PGHOST=localhost |
| 16 | set PGUSER=postgres |
| 17 | set PGPASSWORD=yourpasswordhere |
| 18 | set THEDB=dnddts20 |
| 19 | set PGINSTALL=C:\Program Files (x86)\PostgreSQL\9.1 |
| 20 | REM note the below example is if you are on 32-bit windows choose which install path makes most sense |
| 21 | REM 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 |
| 26 | set PATH=%PATH%;"%PGINSTALL%\bin\" |
| 27 | perl utils/postgis_restore.pl "dnddts_daily.backup" | psql %THEDB% 2> errors.txt |
| 28 | pause |
| 29 | }}} |
| 30 | |
| 31 | * Right mouse click on the .bat file (you may have to choose -- Run as Administrator) |