Upgrading on Red Hat Linux

This section describes how to upgrade from a previous major version of OpenGeo Suite.

If performing a minor upgrade, you may proceed with a typical install.

Note

A “major” version upgrade is from version 3.x to 4.y. A “minor” version upgrade is from 4.x to 4.y.

Warning

This upgrade is not-backward compatible. Irreversible changes are made to the data so that they can’t be used with versions 3.x and below of OpenGeo Suite.

Back up PostGIS databases

Note

The commands in this section require root privileges.

The first step of the upgrade process is to back up your existing PostGIS data.

  1. Change to the root user:

    sudo su -
    
  2. Ensure PostgreSQL is running.

    service postgresql-9.2 start
    
  3. Change to the postgres user:

    su - postgres
    
  4. To backup a PostGIS upgrade utility is used. Download the archive and extract it to a temporary directory. By default, the backup files created from using this script will be saved into this same directory:

    mkdir /tmp/opengeo_backup/pg_backup
    cd /tmp/opengeo_backup/pg_backup
    wget http://repo.opengeo.org/suite/releases/pgupgrade/postgis_upgrade-4.0.zip
    unzip postgis_upgrade-4.0.zip
    

    Warning

    The /tmp directory is not recommended for long term backups, as it can often be purged as part of normal system activity.

  5. Run the backup command:

    perl postgis_upgrade.pl backup
    

    Note

    For more information about supported options run perl postgis_upgrade.pl --help.

  6. The script will run and create a number of files:

    • Compressed dump files for every database backed up (<database>.dmp)
    • SQL output of server roles
  7. Exit back to the root user:

    exit
    
  8. The PostGIS data backup process is complete.

Back up GeoServer data directory

The next step is to back up the GeoServer data directory, located at /usr/share/opengeo-suite-data/geoserver_data.

  1. Shutdown the Tomcat service:

    service tomcat6 stop
    
  2. Copy the old data directory to /tmp:

    cp -r /usr/share/opengeo-suite-data/geoserver_data /tmp/opengeo_backup
    

Uninstall old Suite

You may now uninstall the old version of OpenGeo Suite. Do this by uninstalling the opengeo-geoserver and opengeo-postgis packages:

yum remove opengeo-geoserver opengeo-postgis

Install new Suite

You may now install the new version of OpenGeo Suite. See New installation on Red Hat Linux for details.

Restore PostGIS databases

  1. Ensure PostgreSQL is running:

    service postgresql-9.3 start
    
  2. Change to the postgres user:

    su - postgres
    
  3. Restore your PostGIS data by running the upgrade utility again with the “restore” argument:

    cd /tmp/opengeo_backup/pg_backup
    perl postgis_upgrade.pl restore
    
  4. Your databases and roles will be restored. You can verify that the databases were created and data restored by running psql -l on the command line.

Restore GeoServer data directory

The default GeoServer data directory location for OpenGeo Suite 4.x is located at /var/lib/opengeo/geoserver.

  1. Stop the Tomcat service:

    service tomcat6 stop
    
  2. Rename the new default data directory.

    mv /var/lib/opengeo/geoserver /var/lib/opengeo/geoserver.old
    
  3. Restore the original data directory:

    cp -r /tmp/opengeo_backup/geoserver_data /var/lib/opengeo/geoserver
    
  4. Ensure proper permissions on the restored copy:

    chown -R tomcat6 /var/lib/opengeo/geoserver
    
  5. Start the Tomcat service:

    service tomcat6 start