Updating a major version

This section will show how to update OpenGeo Suite 3.x to 4.8 on Ubuntu Linux.

Note

Warning

This update 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 update process is to back up your existing PostGIS data.

  1. Change to the root user:

    sudo su -
    
  2. Ensure PostgreSQL is running.

    service postgresql start
    
  3. Change to the postgres user:

    su - postgres
    
  4. To backup PostGIS a separate 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 -p /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 /var/lib/opengeo/geoserver.

  1. Shutdown the Tomcat service:

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

    cp -r /var/lib/opengeo/geoserver /tmp/opengeo_backup
    

Uninstall old version

You may now uninstall the old version of OpenGeo Suite.

The package(s) to remove depend on what was installed. Please see the section on Uninstalling for details.

Note

If unsure, run the following command to see the relevant list of packages:

dpkg --get-selections | grep opengeo

Install new version

You may now install the new version of OpenGeo Suite. See the new installation section for details.

Restore PostGIS databases

  1. Ensure PostgreSQL is running:

    service postgresql start
    
  2. Change to the postgres user:

    su - postgres
    
  3. Restore your PostGIS data by running the 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 is located at /var/lib/opengeo/geoserver.

  1. Go back to the root account:

    exit
    
  2. Stop the Tomcat service:

    service tomcat7 stop
    
  3. Rename the new default data directory:

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

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

    chown -R tomcat7 /var/lib/opengeo/geoserver
    
  6. Start the Tomcat service:

    service tomcat7 start
    

After update

Update is now complete. Please see the section on After installation: Working with OpenGeo Suite for Ubuntu Linux to continue.