Andrew Leggett / Sr. Application Consultant

running

If you have a live, CM WebClient web application, you will probably want to upgrade your existing site sometime, whether to fix a bug, add new features, or just to update the graphics.

Upgrading has traditionally been a pain.  You had to make sure no-one was using the system and schedule a window of time where the system would be unavailable.  This is not always practical if your system is used around the world and needs to run 24 hours a day, 365 days a year.

Fortunately, if you are using Tomcat v7 or later as your web server, there is already a built-in solution for this, and it’s incredibly simple to implement.

This feature is called ‘Parallel Deployment’, and this is how it works:

  1. When you are ready to deploy your CM WebClient war file, you just need to rename it to add ‘##’ followed by a sequence number, e.g. rename “MyWebApplication.war” to “MyWebApplication##0001.war”.
  2. Copy this file to your “WebApps” folder in your Tomcat installation.  Tomcat monitors this folder and will automatically unpack and deploy your war file.  Your application will be available to your users at the usual URL.
  3. When you need to upgrade, rename your new war file to include a higher sequence number, e.g. “MyWebApplication##0002.war” and copy it to your “WebApps” folder.
  4. Tomcat will take care of everything from this point.  If there are users currently using the previous version, they will continue to use that version for their current session.  Any new users connecting to the URL will be directed to the new version.  Once all the sessions for the old version have expired, Tomcat will undeploy the old version and clean up the files.
  5. Repeat for each upgrade, just increment the sequence number each time.