Upgrading GeoServer

At the time of writing this book, GeoServer is at its 2.5.0 release, and it's definitely a stable and mature project. It has a well-defined release schedule with major and minor versions released at regular intervals.

Note

For detailed and up-to-date information about the next releases, have a look at http://blog.geoserver.org/2014/02/26/extended-release-schedule/.

Upgrading frequently is a good thing; with any new release, you get many bugs fixed and new features included. Some experimental module, often from the community, may be included in the stable release. If you are running GeoServer in a production site, you have to choose between the benefits of upgrading it frequently and policies that your customer and/or system administrators may have enforced.

In any case, you need to fully understand what upgrading GeoServer means and its consequences on the following:

  • Your service and data
  • Establishing a standard procedure to upgrade your GeoServer installation

In this recipe, you will perform the simple steps required for upgrading.

Please note that in the following steps, I am assuming you are using GeoServer inside a Tomcat container, which is the most commonly used configuration for a production site.

How to do it…

  1. Create a backup copy of your data folder. This is very important for an easy restore if something goes wrong with updating:
    $ sudo tar cvfz /opt/data_dir_geoserver.tar.gz /opt/data_dir_geoserver/*
    
  2. Stop the GeoServer instance:
    $ sudo service tomcat stop
    
  3. Create a backup copy of your Tomcat installation:
    $ sudo tar cvfz /opt/Tomcat7042.tar.gz /opt/Tomcat7042/*
    
  4. Restart GeoServer and undeploy GeoServer from Tomcat using the web interface:
    $ sudo service tomcat start
    
    How to do it…
  5. Now, you can deploy your new GeoServer to Tomcat:
    $ sudo mv /download/geoserver.war /opt/tomcat7042/webapps/.
    
  6. Check whether GeoServer is deployed safely by looking at the log and the web interface. If there is no critical error, you now have a standard installation pointing at the sample dataset. Stop Tomcat and edit the web.xml file to point it again to your custom data directory location:
    $ sudo vi /opt/tomcat7042/webapps/geoserver/WEB-INF/web.xml
    
  7. Find the section with the data directory configuration, uncomment it, and edit it according to your settings:
    <context-param>
        <param-name>GEOSERVER_DATA_DIR</param-name>
        <param-value>/opt/data_dir_geoserver/</param-value>
    </context-param>
  8. Then download, unpack, and install any other plugin and community module you had in your old installation.
  9. Now, you can start your GeoServer again. Check the log and the web interface for any error.

How it works…

If you followed the previous steps, you can guess that upgrading GeoServer is an easy task. In fact, it is usually a straightforward and simple operation.

Some problems may arise if you don't follow a regular upgrade process or you jump from a very old release to the latest one.

Note

Detailed information about major changes in the data directory structure that you should be aware of are usually listed at http://docs.geoserver.org/stable/en/user/datadirectory/migrating.html.

GeoServer is quite a complex piece of software and sharing the same servlet container with other applications may result in out-of-memory issues or library conflicts.

The best option is to use a dedicated Tomcat for GeoServer. In some cases, you're not in control of the deployment environment, and you need to deploy it on the servlet container where other Java applications are hosted.

Also, for these complex configurations, you may follow the previous steps, but you need to modify them in order to avoid problems to other applications.

Also, consider that it is impossible to upgrade without an interruption of the service. So, we should accurately plan for the upgrade operation.

See also

  • The Storing configurations in an RDBMS recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.235.62