
Upgrading your installation
It is a good thing to know that the GeoServer development team is working hard to frequently release new versions. You may be sure that most of the bugs will be fixed in a short time. On the other hand, this means you have to carefully plan an upgrading strategy in order to download and install any new release without having this affect your site too strongly.
Before you get too worried about this, we want to reassure you. Upgrading GeoServer is not a challenging task, and, with some simple steps, you may preserve your configuration when migrating to a new release.
We will explore the interface and the configuration option of GeoServer in the next chapter. For now, keep in mind that all these settings are stored in the file system in a folder called the GeoServer data directory. As you may guess from its name, it may also contain the spatial data you want to publish with GeoServer; although, this is not always the case. The most important content for the migration task is the configuration. All the configuration settings are contained in XML files.
We will design a detailed procedure to upgrade in Chapter 11, Tuning GeoServer in a Production Environment, but we already want your attention on the fundamental steps required as follows:
- Select a folder external to the application for the data directory. By default, the GeoServer data directory is inside the application.
- Backup the data directory frequently and always do a full backup before starting to upgrade GeoServer.
- Undeploy the old version of GeoServer.
- Stop the servlet container, for example, Tomcat.
- Remove any temporary content from the servlet container.
- Start the servlet container and deploy the new GeoServer release.
- Point the new GeoServer to the external data directory.
Another important consideration about the data directory is its internal structure. Time after time, a new release of GeoServer applies changes to the structure that makes the migration an irreversible operation. In other words, the data directory is no more usable by a GeoServer release older than the last you deployed. This is the main reason you should always perform a full backup before starting the upgrade.
As a rule of thumb, patch and minor version migrations, for example, from 2.9.0 to 2.9.1, does not modify the internal structure of data directory, while you should expect issues when upgrading to a major release, for example, from 2.8 to 2.10.
Anyway, keep in mind that some minor version migrations may not be reversible since newer versions of GeoServer may make backward-incompatible changes to the data directory.