Upgrading from 5.5 or 5.6 to 5.6.1

This chapter describes the recommended procedure for upgrading from JasperReports Server:

5.5 or 5.6

to JasperReports Server 5.6.1.

The examples describe how to use the js-upgrade shell scripts to carry out the upgrade operation.

This chapter contains the following sections:

Upgrade Steps Overview
Back Up Your JasperReports Server Instance
Preparing the JasperReports Server 5.6.1 WAR File Distribution
Configuring Buildomatic for Your Database and Application Server
Upgrading to JasperReports Server 5.6.1
Starting and Logging into JasperReports Server 5.6.1
Additional Tasks to Complete the Upgrade
Old Manual Upgrade Steps: 5.5 to 5.6.1

Upgrade Steps Overview

These are the general steps used in this section:

1. Back up your current JasperReports Server instance.
2. Download and set up the new 5.6.1 JasperReports Server WAR file distribution zip.
3. Run the js-upgrade script as described in Upgrading to JasperReports Server 5.6.1.

If your current instance of JasperReports Server has any custom modifications or extensions, keep track of these and re-integrate them into your 5.6 instance after upgrading.

Back Up Your JasperReports Server Instance

First you must backup your JasperReports Server WAR file and jasperserver database so that they can be restored in case there is a problem with the upgrade. These steps are performed from the command line in a Windows or Linux shell.

The following backup example is for Tomcat with the PostgreSQL or MySQL database. For other databases, consult your DB administration documentation for back up information.

Back up your JasperReports Server WAR File:

1. Create a folder location where you can save your jasperserver-pro war file. For example, C:\JS_55_BACKUP or /opt/JS_55_BACKUP.
2. Copy <tomcat>/webapps/jasperserver-pro  to  <path>/JS_55_BACKUP

Back up your Jasperserver Database:

1. Create a folder location (if you did not do so in the step above) where you can save you jasperserver database, For example, C:\JS_55_BACKUP or /opt/JS_55_BACKUP.
2. Run the following commands for PostgreSQL or MySQL:
     PostgreSQL

cd <path>/JS_55_BACKUP

pg_dump --username=postgres  jasperserver  >  js-db-5.5-dump.sql

     MySQL on Windows

cd <path>/JS_55_BACKUP

mysqldump --user=root --password=<password> jasperserver > js-db-5.5-dump.sql

     MySQL on Linux
                cd <path>/JS_55_BACKUP
                mysqldump --user=root --password=<password> --host=127.0.0.1 jasperserver > js-db-5.5-dump.sql

For MySQL, If you receive an error about packet size, see the Troubleshooting appendix of the JasperReports Server Installation Guide.

Preparing the JasperReports Server 5.6.1 WAR File Distribution

Use the buildomatic js-upgrade scripts included in the 5.6.1 WAR file distribution ZIP release package to carry out the upgrade. Follow these steps to obtain and unpack the WAR file distribution ZIP file:

1. The WAR file distribution comes in a file named jasperreports-server-5.6-bin.zip in the compressed ZIP format. Download the WAR file distribution from Jaspersoft technical support (http://support.jaspersoft.com) or contact your sales representative. .
2. Extract all files from jasperreports-server-5.6-bin.zip. Choose a destination, such as a C:\Jaspersoft folder on Windows, /home/<user> on Linux, or /Users/<user> on Mac.

After you unpack the WAR File Distribution Zip, the resulting location will be known as:

<js-install-5.6>

Configuring Buildomatic for Your Database and Application Server

This upgrade procedure uses the js-upgrade-samedb shell script.

For Unix, the bash shell is required for the js-upgrade scripts. If you are installing to a non-Linux Unix platform such as HP-UX, IBM AIX, FreeBSD or Solaris, you need to download and install the bash shell. See the Troubleshooting appendix of the JasperReports Server Installation Guide for more information.

This section shows example configurations for the PostgreSQL, MySQL, and Oracle databases. Other databases are similar.

Example Buildomatic Configuration

The upgrade configuration is handled by the default_master.properties file. Jaspersoft provides a sample configuration file for each database. You must specify your database credentials and your application server location, and rename the file to default_master.properties.

PostgreSQL Example

This example shows how to configure default_master.properties for PostgreSQL.

1. Locate the postgresql_master.properties sample configuration file:

Database

Master Properties File

PostgreSQL

<js-install-5.6>/buildomatic/sample_conf/postgresql_master.properties

2. Copy the file to <js-install-5.6>/buildomatic
3. Rename the file to default_master.properties
4. Edit default_master.properties for your database and application server:

Database

Sample Property Values

PostgreSQL

appServerType=tomcat6 [tomcat7, tomcat6, jboss, glassfish2, glassfish3]
appServerDir=c:\\apache-tomcat-6.0.26 (for example)
dbUsername=postgres
dbPassword=postgres
dbHost=localhost

MySQL Example

This example shows how to configure default_master.properties for MySQL.

1. Locate the mysql_master.properties sample configuration file:

Database

Master Properties File

MySQL

<js-install-5.5>/buildomatic/sample_conf/mysql_master.properties

2. Copy the file to <js-install-5.6>/buildomatic
3. Rename the file to default_master.properties
4. Edit default_master.properties for your database and application server:

Database

Sample Property Values

MySQL

appServerType=tomcat6 [tomcat7, tomcat6, jboss, glassfish2, glassfish3]
appServerDir=c:\\Apache Software Foundation\\Tomcat-6 (for example)
dbUsername=root
dbPassword=password
dbHost=localhost

Oracle Example

This example shows how to configure default_master.properties for Oracle.

1. Locate the oracle_master.properties sample configuration file:

Database

Master Properties File

Oracle

<js-install-5.6>/buildomatic/sample_conf/oracle_master.properties

2. Copy the file to <js-install-5.6>/buildomatic
3. Rename the file to default_master.properties
4. Edit default_master.properties for your database and application server:

Database

Sample Property Values

Oracle

appServerType=tomcat6 [tomcat7, tomcat6, jboss, glassfish2, glassfish3]
appServerDir=c:\\Apache Software Foundation\\Tomcat-6 (for example)
dbUsername=jasperserver
dbPassword=password
sysUsername=system
sysPassword=password
dbHost=localhost
5. As of 5.6.1, JasperReports Server includes the TIBCO JDBC drivers for the following commercial databases: Oracle, SQL Server, or DB2. If you want to use a different JDBC driver, you need to copy it to the correct location and edit default_master.properties before running the upgrade steps.

With Oracle, for example, the alternate JDBC jar should be copied into the following location:

<js-install-5.6>/buildomatic/conf_source/db/oracle/jdbc

For SQL Server or DB2, the driver would get copied to the following locations respectively:

<js-install-5.6>/buildomatic/conf_source/db/sqlserver/jdbc

<js-install-5.6>/buildomatic/conf_source/db/db2/jdbc

Once you have copied the driver, in your default_master.properties file, go to the Setup Standard JDBC Driver section and edit it according to the instructions in that section.

Additional Step when Using JBoss 7 (and Oracle, SQL Server, or DB2)

If you are using JBoss 7 as your application server and Oracle, SQL Server, or DB2 as your database, and you are using a driver other than the TIBCO JDBC driver, there is an additional set of required steps to handle the JDBC driver.

You will need to make an explicit reference to your JDBC driver file name so that JBoss 7 will know the exact file name.

1. First update your default_master.properties file to specify the exact name (artifactId and version) of your JDBC driver:

Edit: <js-install-5.6>/buildomatic/default_master.properties

Look for the section "Setup JDBC Driver"

Uncomment and edit the two lines shown below:

# maven.jdbc.artifactId=ojdbc5

# maven.jdbc.version=11.2.0

So that they look like this:

maven.jdbc.artifactId=ojdbc5

maven.jdbc.version=11.2.0

(This will work for a driver with the filename: ojdbc5-11.2.0.jar)

2. Edit your jboss-deployment-structure.xml file so that the JDBC filename is specified:

Edit: <js-install-5.6>/buildomatic/install_resources/jboss/jboss-deployment-structure.xml

Look for the section "Setup JDBC Driver"

Uncomment and edit the line for your database type (for instance):

<!-- <resource-root path="WEB-INF/lib/ojdbc5-11.2.0.jar" use-physical-code-source="true"/> -->

So that it looks like this:

<resource-root path="WEB-INF/lib/ojdbc5-11.2.0.jar" use-physical-code-source="true"/>

(This will work for a driver with the filename: ojdbc5-11.2.0.jar)

Upgrading to JasperReports Server 5.6.1

Now that your buildomatic scripts have been configured, you can complete the upgrade.

Make sure you have backed up your jasperserver database before proceeding.

Make sure you have backed up your old JasperReports Server WAR file before proceeding.

1. Stop your application server
2. Start your database server
3. Run the following commands:

Commands

Description

cd <js-install-5.6>/buildomatic

js-upgrade-samedb.bat

(Windows) Upgrade jasperserver-pro war file, upgrade jasperserver database to 5.6, add 5.6 repository resources into the database

./js-upgrade-samedb.sh

(Linux) Upgrade jasperserver-pro war file, upgrade jasperserver database to 5.6, add 5.6 repository resources into the database

js-upgrade Test

You can run the js-upgrade scripts in test mode using the test option. For example, in Windows enter:

cd <js-install-5.6>/buildomatic

js-upgrade-samedb.bat test

In test mode, the js-upgrade scripts check your default_master.properties settings. The application server location is validated and the capability to connect to the specified database is validated. Using test mode can help debug issues, such as an incorrect database password. Your system is not altered when executing the script in test mode.

Output Log Location

The js-upgrade script creates an output log that captures standard output and error output. If there are any problems during the execution of the script or if you want to remember which options you chose, you can open the output log file.

The output log file is located here:

<js-install-5.6>/buildomatic/logs/js-upgrade-<date>-<number>.log

Errors

If you encounter errors during the js-upgrade script execution, first look at the output log to see if you can spot any errors. Additionally, you should refer to the Troubleshooting appendix of the JasperReports Server Installation Guide. The information in this appendix applies to both js-upgrade scripts and the js-install scripts.

If you need to modify values in your default_master.properties file, you can simply edit the file. When the js-upgrade script is run again, the new values will be used.

Starting and Logging into JasperReports Server 5.6.1

Start your application server. Your database should already be running.

Clearing Your Browser Cache

Before you log in, make sure you and your end users clear the browser cache. JavaScript files, which enable the UI elements of JasperReports Server, are typically cached by the browser. Clear the cache to ensure that the newer files are used.

Logging into JasperReports Server

Log in using the following URL, user IDs, and passwords:

URL: http://localhost:8080/jasperserver-pro

User ID

Password

Description

superuser <your-password>

System-wide administrator

jasperadmin <your-password>

Administrator for the default organization

Your JasperReports Server instance has now been upgraded to 5.6.1. In the event of startup or login problems, refer to the Troubleshooting appendix of the JasperReports Server Installation Guide.

Additional Tasks to Complete the Upgrade

The tasks described below should be done when the application server is shutdown.

Clearing the Application Server Work Folder

Application servers have work folders where JasperReports Server files are compiled and cached and other objects are stored. When you update the WAR file or license, the buildomatic deploy-webapp-pro target should automatically clear the application server’s work directory, but it’s a good practice to double-check. A permission problem, or some other problem, could prevent the clearing of the work folder.

To clear the work folder in Tomcat:

1. Change directory to <tomcat>/work.
2. Delete all the files and folders in this directory.

Clearing the Application Server Temp Folder

JasperReports Server uses caching to speed operations within the application. In the application server, caching files are created and stored for this caching functionality. Typically, these cached files are stored in a temp folder. Clear this temp folder to avoid any conflicts after the upgrade is complete. For Apache Tomcat the temp folder is <tomcat>/temp. (In general, the temp folder used by an Application Server corresponds to the path pointed at by the java.io.tmpdir Java system property.)

To clear the temp folder in Apache Tomcat:

1. Change directory to <tomcat>/temp
2. Delete all the files and folders in this directory.

Clearing the Repository Cache Database Table

In the jasperserver database, compiled JasperReports Library resources are cached in the JIRepositoryCache table for increased efficiency at runtime. In some cases, you may encounter errors running reports after an upgrade. Because the JasperReports Library JAR is typically updated with each new JasperReports Server release, old cached items can get out of date and thus cause errors at runtime. If you encounter errors that mention a JasperReports Library “local class incompatible,” check your repository cache table. In summary, you can clear your jasperserver database cache table whether there are errors or not as part of this upgrade process.

To manually clear the repository cache database table, run a SQL command similar to one shown below:

update JIRepositoryCache set item_reference = null;

delete from JIRepositoryCache;

Old Manual Upgrade Steps: 5.5 to 5.6.1

This section has the older, manual upgrade steps that were in place before the js-upgrade shell scripts were implemented in the 4.0 release. These are provided in the following table as a reference, mainly for internal use. The js-upgrade shell scripts execute these buildomatic targets “behind the scenes.” Jaspersoft recommends using the js-upgrade scripts described in the beginning of this upgrade chapter instead of these manual steps.

Older buildomatic upgrade steps for this chapter are the following:

Commands

Description

cd <js-install-5.6>/buildomatic

js-ant upgrade-5.5-5.6-pro

Execute SQL script to upgrade database to 5.6.

Executes script buildomatic/install_resources/sql/<dbType>/upgrade-<dbType>-5.5.0-5.6.0-pro.sql

js-ant import-minimal-for-upgrade-pro

Loads themes and other core resources for 5.6.1.

Note: "import-minimal-for-upgrade" will import core resources in an "update" mode so that the older 5.5 core resources will be overwritten. Additionally, the "skip-user-update" option will be applied so that the superuser and jasperadmin users will not have their passwords modified.

js-ant import-sample-data-upgrade-pro

(Optional) This step is optional. Loads the 5.6.1 sample data.

js-ant deploy-webapp-pro

Delete old 5.5 war file, deploy the 5.6.1 war file.

Version: 
Feedback