Chapter 8. Upgrading

Table of Contents

Recommended Upgrade Steps
Backup
Installation of the new Version
Database Upgrade
Test new Installation against Upgraded Database
Re-build Custom Code
Upgrade the Struts Storefront
Assess Changes to WebApp Configuration files
Assess Changes to Tomcat Configuration files
KonaKart Directory Structure Changes
KonaKart Message Changes
Documentation and javadoc Changes
Admin App Changes

KonaKart has been designed with upgrading in mind. If you customize KonaKart using the recommended techniques (particularly if you've used the APIs) the upgrade process should be a fairly straightforward process. This section provides advice on the processes to follow in order to achieve a painless upgrade.

Of fundamental importance is that the KonaKart APIs remain backwards-compatible between releases. (Very occasionally a "backwards-compatibility warning" is issued when an API changes but this is very rare).

This means that code that you have written against the APIs will continue to work for a later version. Therefore, your investment in the code you have written is preserved.

This is in contrast to many other eCommerce systems where customisations are deeply-integrated with the core system resulting in extremely costly and time-consuming upgrades.

You may have written your storefront application in a certain technology of your choice (for example Apache Wicket, JSF etc) that uses the KonaKart APIs. In theory, the upgrade process will simply be a matter of replacing the jars from the earlier version with the new jars in the version you wish to upgrade to. Your storefront may not be able to take advantage of the new features provided in the new version (without modifying your storefront application to use the new features) but your storefront should continue to work as before because the APIs are backwards-compatible. In practice the upgrade process can sometimes be a little more complicated than just replacing the jars and some of the more complicated cases are discussed below.

Recommended Upgrade Steps

It's difficult to define an ideal set of steps for every situation as the approach you take depends a lot on what your starting position is. The following should be taken as a set of recommended steps to consider in the overall process but not all will be applicable to every upgrade.

Before starting it is advised that you read the release notes for the version you are planning to upgrade to. These can be found at http://www.konakart.com/downloads/release-notes

Backup

It is always recommended that you backup all data and code belonging to the version that you wish to upgrade. Ensure you have backups before proceeding.

Installation of the new Version

Install the new version alongside the old version (use a new database schema so that they don't collide). Installation using the graphical wizards is recommended for one-off installations but the silent installation may be preferable in highly-automated environments where installations need to be repeated several times.

This new installation will include the default version of the new storefront client and any new directories, configuration files, documentation and jars provided in the new version.

This new installation will provide an extremely useful reference platform that you can use for a variety of purposes such as verifying the behaviour of new features.

All the updated source code provided with KonaKart will be included in this new installation so if any of these items have been customised these customisations may need to be merged with the new versions.

Database Upgrade

An upgrade SQL file (one for each database type) is provided that needs to be run to upgrade the database from one version to the next. If you are jumping a few versions you must run each upgrade SQL file in sequence in order to prepare the database for the new version. The database upgrade scripts will not destroy your data (customers, orders, products etc) but it is highly-recommended to run the upgrade process on a test environment before applying it to any production database.

On Windows, (assuming KonaKart was installed in the default location), the database upgrade scripts for MySQL can be found in the following directory:

C:/KonaKart/database/MySQL

Test new Installation against Upgraded Database

Having upgraded the database from the previous version you can verify that the new version of KonaKart runs fine against the upgraded database by changing the database parameters in the konakart.properties and konakartadmin.properties files in the new installation's webapps (konakart and konakartadmin webapps).

Re-build Custom Code

If you have custom code (including your own order total, shipping and payment modules, one-page-checkout code etc) that uses the KonaKart libraries you will need to recompile it against the new jars.

Exactly how you go about this task will depend on various factors including how you have structured your development environment and build system.

If you use the supplied ANT build files to build your custom code you should copy your custom sources across to the new custom directory and build from there. This will pick up the new ANT build file and the new libraries that will be required. Depending on what you have done in your custom code it is possible that you may have compilation errors to fix at this stage.

If you have your own build system in place for your custom code you should copy the dependent jars from the new installation to your custom build system and rebuild. Again, depending on what you have done in your custom code, it is possible that you may have compilation errors to fix at this stage.

Upgrade the Struts Storefront

Of all the upgrade tasks this can be the most complex as it involves the careful comparison of your storefront code with the storefront code in the new version.

Because of the backwards compatibility of the APIs in theory you should not need to change your modified storefront at all and it will continue working as before.

You only need to change your storefront code if you want to upgrade your storefront to the new storefront code which will use the new features introduced in the new version of KonaKart.

If you wish to upgrade your storefront you will have to merge your own changes with the new code in the following areas:

  • Struts Configuration Files

  • Struts Action Classes, business logic and forms

  • JSPs

The best way to execute the merges will depend on how many changes you've made. If you have made a very large number of changes in these areas it's likely that the easiest option is to merge the new storefront features into your current storefront code. If, on the other hand, you have made very few changes to the storefront code, the best option is probably to merge those few changes into a copy of the new storefront code.

Assess Changes to WebApp Configuration files

Sometimes changes are made to the webapp configuration files. An example is when JSON was introduced a new section was introduced into the web.xml file for the konakart webapp to define the new servlet.

These key configuration files should be compared with your current versions to assess whether the changes are required. Files to pay particular attention to are:

  • ${KONAKART_HOME}/webapps/konakart/WEB-INF/web.xml

  • ${KONAKART_HOME}/webapps/konakartadmin/WEB-INF/web.xml

  • ${KONAKART_HOME}/webapps/birtviewer/WEB-INF/web.xml

Assess Changes to Tomcat Configuration files

Some releases include an upgrade of tomcat. If you use tomcat for KonaKart you will probably want to upgrade to the same version of tomcat and move your current system across to the new tomcat installation.

Some releases use the same version of tomcat (as the previous version) but have modified configuration files that should be compared with your current versions to assess whether the changes are required. Files to pay particular attention to are:

  • ${KONAKART_HOME}/conf/context.xml

  • ${KONAKART_HOME}/conf/server.xml

  • ${KONAKART_HOME}/conf/web.xml

KonaKart Directory Structure Changes

Sometimes new releases provide new functionality that requires a new directory structure. An example is when Solr was first introduced a new solr directory was added at the base of the KonaKart home directory. Check your reference installation for any new directories and consider introducing them into your existing structure (where you place them will depend a lot on which App Server you happen to be using).

KonaKart Message Changes

Most new releases introduce new message strings that may need to be translated into the languages you need to support in your system. The message files to consider are:

  • ${KONAKART_HOME}/webapps/konakart/WEB-INF/classes/Messages.properties

  • ${KONAKART_HOME}/webapps/konakartadmin/WEB-INF/classes/AdminMessages.properties

  • ${KONAKART_HOME}/webapps/konakartadmin/WEB-INF/classes/AdminHelpMessages.properties

To help identify the new messages introduced between particular versions of KonaKart you can refer to the files in the ${KONAKART_HOME}/utils/kkMessages/new-Messages , ${KONAKART_HOME}/utils/kkMessages/new-AdminMessages and ${KONAKART_HOME}/utils/kkMessages/new-AdminHelpMessages directories. When new messages are introduced between the specified versions in the above 3 Message properties file types a file is created that contains only the newly introduced messages.

If a particular *Message_X.X.X.X_to_Y.Y.Y.Y.properties properties file is missing from the ${KONAKART_HOME}/utils/kkMessages/new-* directory it means that no new messages of that type were introduced between the two versions.

Documentation and javadoc Changes

It is highly-recommended that the "doc" directory of the new installation is checked for the latest documentation. The User Guide will be updated for every release and additional documentation may be added to this directory covering specific areas. Note also that the javadoc will change in each new release so if you refer to a local copy for the javadoc you should reference that in the new installation under webapps/javadoc/ .

Admin App Changes

New panels are often added to the Admin App in new versions of KonaKart. You need to check that the roles that you have defined for your Admin App users are appropriate for your needs. You may find that you need to allow access to some or all of the new panels otherwise they will not become visible to your Admin App users. It can be useful to install a fresh copy of KonaKart alongside your development system (use a new database schema) to allow you to refer to the default set-up for the Admin App. This default set up will show you all the roles that are assigned to the admin@konakart.com user with a standard default installation.