Updating a major version¶
This section will show how to update OpenGeo Suite 3.x to 4.8 on Ubuntu Linux.
Note
- For new installations, please see the section on Installing.
- For upgrading to OpenGeo Suite Enterprise, please see the section on Upgrading to OpenGeo Suite Enterprise.
- For updating from a previous minor version of OpenGeo Suite (4.x), please see the Updating a minor version section.
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.
Change to the
rootuser:sudo su -
Ensure PostgreSQL is running.
service postgresql start
Change to the
postgresuser:su - postgres
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
/tmpdirectory is not recommended for long term backups, as it can often be purged as part of normal system activity.Run the backup command:
perl postgis_upgrade.pl backupNote
For more information about supported options run
perl postgis_upgrade.pl --help.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
- Compressed dump files for every database backed up (
Exit back to the
rootuser:exitThe 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.
Shutdown the Tomcat service:
service tomcat7 stop
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¶
Ensure PostgreSQL is running:
service postgresql start
Change to the
postgresuser:su - postgresRestore your PostGIS data by running the utility again with the “restore” argument:
cd /tmp/opengeo_backup/pg_backup perl postgis_upgrade.pl restore
Your databases and roles will be restored. You can verify that the databases were created and data restored by running
psql -lon the command line.
Restore GeoServer data directory¶
The default GeoServer data directory location for OpenGeo Suite is located at /var/lib/opengeo/geoserver.
Go back to the root account:
exitStop the Tomcat service:
service tomcat7 stop
Rename the new default data directory:
mv /var/lib/opengeo/geoserver /var/lib/opengeo/geoserver.old
Restore the original data directory:
cp -r /tmp/opengeo_backup/geoserver /var/lib/opengeo/geoserverEnsure proper permissions on the restored copy:
chown -R tomcat7 /var/lib/opengeo/geoserverStart 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.