Jump to content
  • This documentation is an older version of JasperReports Server Upgrade Guide - Community Edition. View the latest documentation.

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

    3.7, 3.7.1, 4.0, 4.0.1, 4.1, 4.2, 4.2.1, 4.5, 4.5.1, 4.7, 4.7.1, 5.0, 5.1, 5.2, or 5.5

    to JasperReports Server 6.0.

    The upgrade procedures described in this chapter use the JasperReports Server WAR File Distribution ZIP release package and the included buildomatic scripts.

    The procedure in this chapter can also be used to upgrade JasperReports Server 5.6 or 5.6.1 to 6.0. However, we recommend you use the procedure in Upgrading from 5.6 to 6.0.

    In this chapter the examples shown will use JasperReports Server 5.5 as the version being upgraded from.

    This chapter contains the following sections:

    Upgrade Steps Overview
    Planning Your Upgrade
    Back Up Your JasperReports Server Instance
    Exporting Current Repository Data
    Preparing the JasperReports Server 6.0 WAR File Distribution
    Configuring Buildomatic for Your Database and Application Server
    Upgrading to JasperReports Server 6.0
    Starting and Logging into JasperReports Server 6.0
    Additional Tasks to Complete the Upgrade
    Old Manual Upgrade Steps

    Upgrade Steps Overview

    These are the general steps used in this section:

    1. Plan your upgrade.
    2. Back up your current JasperReports Server instance.
    3. Export your existing repository data. For example, export your 5.5 data.
    4. Download and set up the new 6.0 JasperReports Server WAR file distribution zip.
    5. Run the js-upgrade script as described in Upgrading to JasperReports Server 6.0.

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

    Planning Your Upgrade

    There is a planning chapter you should review in order to see if there are changes which will affect your deployment. This chapter can be found here: Planning Your Upgrade .

    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 war file. For example, C:JS_55_BACKUP or /opt/JS_55_BACKUP.
    2. Copy <tomcat>/webapps/jasperserver  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 your 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

    cd <path>/JS_55_BACKUP

    Windows:

    Linux:

    note-icon-ns_28x28.png.505545d7a0c2c7a1df6febd12afdba27.png

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

    Exporting Current Repository Data

    You need to export your old repository data, for example your 5.5 repository data, using the JasperReports Server export utility. You can export in the following ways:

    Use the buildomatic scripts (if you originally installed using buildomatic).
    Use the js-export-ce.bat/.sh script found in the <js-install>/buildomatic folder.

    Using Buildomatic Scripts to Export Data

    If you configured buildomatic and your default_master.properties file for export as described in the JasperReports Server Administrator Guide, you can export your repository data. For example, to export 5.5 repository data, use the following commands:

    1. Navigate to the buildomatic directory:

    cd <js-install-5.5>/buildomatic

    2. Run buildomatic with the export target:

    Windows:

    js-ant.bat export-everything-ce -DexportFile=js-5.5-export.zip[/code]                    

    Linux:

    ./js-ant export-everything-ce -DexportFile=js-5.5-export.zip[/code]                    

    note-icon-ns_28x28.png.e31a909988650ab4b1310405b70b5817.png

    Note the location of this export file so that you can use it during the 6.0 upgrade process.

    Using the js-export Script to Export Data

    To use the js-export-ce.bat/.sh script, navigate to the buildomatic folder, for example, <js‑install‑5.5>/buildomatic. If you are using the PostgreSQL database then the js-export script should already be configured to run. If you are using a different database, or you have changed database passwords, you may need to update the js‑export configuration.

    The import-export utility for JasperServer 3.7 needs additional configuration. For complete information on the standard import-export options refer to the JasperReports Server Administrator Guide.

    Run the following commands:

    1. Navigate to the buildomatic directory:

    cd <js-install-5.5>/buildomatic

    2. Run the js-export script:

    Windows:

    js-export-ce.bat --everything --output-zip js-5.5-export.zip[/code]                    

    Linux:

    js-export-ce.sh --everything --output-zip js-5.5-export.zip[/code]                    

    note-icon-ns_28x28.png.815d85354885cfa7bb9fff6a4644762e.png

    Note the location of this export file so that you can use it during the 6.0 upgrade process.

    Preparing the JasperReports Server 6.0 WAR File Distribution

    Use the buildomatic js-upgrade scripts included in the 6.0 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-cp-6.0-bin.zip in the compressed ZIP format. Download the WAR file distribution from http://community.jaspersoft.com.
    2. Extract all files from jasperreports-server-cp-6.0-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-6.0>

    Configuring Buildomatic for Your Database and Application Server

    This upgrade procedure uses the js-upgrade-newdb-ce shell script.

    note-icon-ns_28x28.png.8309b12b254e635ab0a2e045c3d6e115.png

    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 and MySQL databases.

    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-6.0>/buildomatic/sample_conf/postgresql_master.properties

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

    Database

    Sample Property Values

    PostgreSQL

    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-6.0>/buildomatic/sample_conf/mysql_master.properties

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

    Database

    Sample Property Values

    MySQL

    Upgrading to JasperReports Server 6.0

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

    warning-icon-ns_28x28.png.0a5eaec61ead4b620867ea680decd327.png

    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-6.0>/buildomatic

    Change to buildomatic directory

    js-upgrade-newdb-ce.bat <path>js-5.5-export.zip

    (Windows) Upgrade jasperserver war file, drop and recreate the database, import data file from previous version.

    ./js-upgrade-newdb-ce.sh <path>/js-5.5-export.zip

    (Linux) Upgrade jasperserver war file, drop and recreate the database, import data file from previous version.

    note-icon-ns_28x28.png.2aa3e060cc34c6b7a23b7831cb1d5c8b.png

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

    js-upgrade Test Mode

    You can run the js-upgrade script in test mode using the test option. For example, on Window, enter:

    cd <js-install-6.0>/buildomatic

    js-upgrade-newdb-ce.bat test <path>/js-5.5-export.zip

    In test mode, the js-upgrade scripts check your default_master.properties settings. The application server location and the capability to connect to the specified database are validated. Using test mode can help debug issues such as an incorrect database password. Your system will not be 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-6.0>/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. Also, refer to the Troubleshooting appendix of the JasperReports Server Installation Guide. The information in this appendix applies to js-upgrade scripts as well as js-install scripts.

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

    Starting and Logging into JasperReports Server 6.0

    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

    User ID

    Password

    Description

    Administrator for the default organization

    Your JasperReports Server instance has now been upgraded to 6.0. 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.

    Handling JasperReports Server Customizations

    If you made modifications or customizations to the original JasperReports Server application, JasperReports Server 5.5 for example, these configurations are typically found in the WEB-INF/applicationContext-*.xml set of files.

    Configuration modifications, such as client-specific security classes or LDAP server configurations, need to be hand-copied from your previous environment and re-integrated into the upgraded environment.

    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, the buildomatic deploy-webapp-ce 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. Caching files are created and stored in the application server to support this functionality. Typically, these cached files are stored in a temp folder. Clear this temp folder to avoid any conflicts after the upgrade is complete. Typically, the temp folder used by an application server corresponds to the path pointed at by the java.io.tmpdir Java system property. For Apache Tomcat the temp folder is <tomcat>/temp.

    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. 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

    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 (using a 5.5 upgrade as an example):

    Commands

    Description

    cd <js-install-6.0>/buildomatic

     

    js-ant drop-js-db

    js-ant create-js-db

    js-ant init-js-db-ce

    This will delete and recreate your jasperserver db. Make sure your original database is backed up.

    js-ant import-minimal-ce

     

    js-ant import-upgrade

    -DimportFile="<path-and-filename>"

    The -DimportFile should point to the <path> and <filename> of the js-5.5-export.zip file you created earlier.

    On Windows, you must use double quotation marks (“) if your path or filename contains spaces. On Linux, you must use double quotation marks, escaped with a backslash (”) in this case.

    Note: "import-upgrade" will import resources from the 5.5 instance in a "non-update" mode (so that core resources from 6.0 will stay unchanged). Additionally, the "update-core-users" option will be applied so that the superuser and jasperadmin users will have the same password as set in the 5.5 instance.

    js-ant import-sample-data-upgrade-ce

    (Optional) This step is optional; it loads the new sample data. The old sample data is overwritten, so you may need to redo certain changes such as configuring the sample data sources for your database.

    js-ant deploy-webapp-ce

    Delete the existing older war file, deploy the new war file.

     


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...