Nov 23, 2011

How to upgrade Geoserver 2.1.1 to 2.1.2

From 2.1.1 to 2.1.2, Ubuntu 10.04 Server, Tomcat6

Note: all those commands need to be done as root (or alternatively, run sudo before the command)
  1. Stop Apache tomcat:
    /etc/init.d/tomcat stop 
  2. Backup the your directories, this could be different from your own installation: /var/geoserver-data, /opt/tomcat/webapps/geoserver/  
    tar -cf geoserver-data-nov-17.tar /var/geoserver-data # takes quite long on current geoserver installation (orthofotos, ...)
    gzip geoserver-data-nov-17.tar
    tar -cf geoserver-app-nov-17.tar /opt/tomcat/webapps/geoserver
    gzip geoserver-app-nov-17.tar
  3. Additionally, backup web.xml file from WEB-INF directory:
    cp /opt/tomcat/webapps/geoserver/WEB-INF/web.xml web-backup-nov17.xml
  4. Download latest (in this case: 2.1.2) geoserver version (war archive)
  5. Unzip it
  6. Copy it to the tomcat webapps directory
    cp geoserver.war /opt/tomcat/webapps/geoserver.war
  7. Delete old geoserver installation
    rm -rf /opt/tomcat/webapps/geoserver/
  8. Start Tomcat again
    /etc/init.d/tomcat start
  9. Wait... (this can take a while, monitor CPU usage via htop or other tools)
  10. Check /opt/tomcat/webapps/ directory, you should see a subdirectory geoserver very soon
    ls -la /opt/tomcat/webapps/
  11. Verify that new geoserver version is running by trying to access
  12. We're not done yet, let's put the old configuration file in place again:
    cp web-backup-nov17.xml /opt/tomcat/webapps/geoserver/WEB-INF/web.xml
  13. Restart tomcat once again and all should be good in update land.
    /etc/init.d/tomcat restart