Chapter 4. Upgrading JBoss Portal 2.4 to 2.6
Prev |  | Next

## Chapter 4. Upgrading JBoss Portal 2.4 to 2.6

### Roy Russo

`<roy at jboss dot org>`

### Boleslaw Dawidowicz

`<boleslaw dot dawidowicz at redhat dot com>`

### Warning

Before performing any instructions or operations in this chapter, back up your database and the entire JBoss EAP or JBoss AS directory!

## 4.1. Manual Upgrade

The database schema has not changed since JBoss Portal 2.4; however, there are several differences when using a database created by JBoss Portal 2.4, that prevent simply deploying the latest version of JBoss Portal. For example, some portlets are no longer present in JBoss Portal 2.6, and certain existing portlets are now packaged differently. This chapter describes updating a MySQL database created by JBoss Portal 2.4, for use with JBoss Portal 2.6.

Users, roles, and pages created in JBoss Portal 2.4 should be accessible in JBoss Portal 2.6 deployments.

The upgrade procedure can be straightforward:

1. If you are using the JBoss Portal binary, remove the `$JBOSS_HOME/server/default/deploy/jboss-portal.sar/` directory. If JBoss Portal was built from source, remove the `$JBOSS_HOME/server/default/deploy/jboss-portal.sar` file.

2. Update the data in the JBoss Portal database, as described in Section 4.1.2, “Updating the Database”.

3. Deploy JBoss Portal 2.6.

### 4.1.1. Themes

In JBoss Portal 2.6, portal pages contain additional areas, such as the Login, Admin, and Dashboard links, on the top right-hand corner of portal pages:

Since portal pages now contain additional areas, certain themes have changed. If a default theme that exists in JBoss Portal 2.6 is used, such as renaissance, no configuration should be necessary. Using old themes from JBoss Portal 2.4 may make JBoss Portal 2.6 unusable, for example, not being able to log in. To update custom themes, refer to the bundled JBoss Portal 2.6 themes as an example.

### 4.1.2. Updating the Database

The following tables contain all references to portlets:

- JBP_INSTANCE

- JBP_WINDOW

- JBP_OBJECT_NODE

All procedures described in the following sections can performed using the JBoss Portal 2.4 Admin portlet. Treat these directions as guidelines when migrating a large JBoss Portal deployment. Database data can be updated manually using the correct tools for your RDBMS. For example, if you are using a MySQL database, you can use the MySQL Query Browser.

During the upgrade process, legacy references have to be cleaned up, to either remove them, or to allow JBoss Portal 2.6 to recreate them correctly. Remove all references (instances and windows) to the portlets listed below, as they are not present in JBoss Portal 2.6. This can be done using the JBoss Portal 2.4 Admin portlet:

- HeaderContentPortlet

- URLPortlet

- TestPortlet

- PortletA

- PortletB

- SecuredTestPortlet

- CharsetPortlet

- CounterPortlet

- CachedCounterPortlet

- ExceptionPortlet

- PortletSessionPortlet

- EncodingPortlet

The following instructions refer to a standard JBoss Portal 2.4 deployment. If core portlets, portlet instances, or portlet windows were renamed, make the appropriate modifications. The following is an example of the MySQL Query Browser:

### Requested Resource Error

When running JBoss Portal 2.6 with a database created by JBoss Portal 2.4, a non-existing portlet will try to be displayed, resulting in a `404`, `The requested resource() is not available` error.

### 4.1.3. Portlet Names

Names of certain core bundled-portlets have changed. Destroy the following instances and use the Admin portlet to recreate them, or edit the JBP_INSTANCE table as follows:

- Change local.samples.JSPPortlet in the PORTLET_REF column to local./portal-jsp-samples.JSPPortlet.

- Change local.portal.CMSPortlet in the PORTLET_REF column to local./portal-cms.CMSPortlet.

- Change local.portal.CMSAdminPortlet in the PORTLET_REF column to local./portal-cms.CMSAdminPortlet.

- Change local.portal.ManagementPortlet in the PORTLET_REF column to local./portal-admin.AdminPortlet.

Some portlets are no longer present in JBoss Portal 2.6, and certain existing portlets are now packaged differently. Remove the following entries in the JBP_INSTANCE table, so that JBoss Portal 2.6 can recreate them:

- rows containing NewsPortletInstance2 in the ID column.

- rows containing local.portal.NavigationPortlet in the PORTLET_REF column.

- rows containing local.samples.HeaderContentPortlet in the PORTLET_REF column.

- rows containing local.samples.WeatherPortlet in the PORTLET_REF column.

- rows containing local.samples.NewsPortlet in the PORTLET_REF column.

- rows containing local.samples.URLPortlet in the PORTLET_REF column.

- rows containing local.samples.TestPortlet in the PORTLET_REF column.

- rows containing local.samples.PortletA in the PORTLET_REF column.

- rows containing local.samples.PortletB in the PORTLET_REF column.

- rows containing local.samples.SecuredTestPortlet in the PORTLET_REF column.

- rows containing local.samples.CharsetPortlet in the PORTLET_REF column.

- rows containing local.samples.CounterPortlet in the PORTLET_REF column.

- rows containing local.samples.CachedCounterPortlet in the PORTLET_REF column.

- rows containing local.samples.ExceptionPortlet in the PORTLET_REF column.

- rows containing local.samples.PortletSessionPortlet in the PORTLET_REF column.

- rows containing local.samples.EncodingPortlet in the PORTLET_REF column.

Remove the following entries in the JBP_WINDOW table, so that JBoss Portal 2.6 can recreate them:

- rows containing NavigationPortletInstance in the INSTANCE_REF column.

- rows containing URLPortletInstance in the INSTANCE_REF column.

- rows containing PortletAInstance in the INSTANCE_REF column.

- rows containing PortletBInstance in the INSTANCE_REF column.

- rows containing EncodingPortletInstance in the INSTANCE_REF column.

- rows containing PortletSessionPortletInstance in the INSTANCE_REF column.

- rows containing CachedCounterPortletInstance in the INSTANCE_REF column.

- rows containing CounterPortletInstance in the INSTANCE_REF column.

- rows containing CharsetPortletInstance in the INSTANCE_REF column.

- rows containing SecuredTestPortletInstance in the INSTANCE_REF column.

- rows containing SecuredTestPortletInstance in the INSTANCE_REF column.

- rows containing ExceptionPortletInstance in the INSTANCE_REF column.

- rows containing HeaderContentPortletInstance in the INSTANCE_REF column.

- rows containing TestPortletInstance in the INSTANCE_REF column.

- rows containing MissingPortletInstance in the INSTANCE_REF column.

Remove the following entries in the JBP_OBJECT_NODE table, so that JBoss Portal 2.6 can recreate them:

- rows containing NavigationPortletWindow in the NAME column.

- rows containing URLPortletWindow in the NAME column.

- rows containing PortletAWindow in the NAME column.

- rows containing PortletBWindow in the NAME column.

- rows containing MissingInstanceWindow in the NAME column.

- rows containing EncodingPortletWindow in the NAME column.

- rows containing PortletSessionPortletWindow in the NAME column.

- rows containing CachedCounterPortletWindow in the NAME column.

- rows containing CounterPortletWindow in the NAME column.

- rows containing CharsetPortletWindow in the NAME column.

- rows containing SecuredTestPortletWindow in the NAME column.

- rows containing ExceptionPortletWindow in the NAME column.

- rows containing MissingPortletWindow in the NAME column.

- rows containing HeaderContentPortletWindow in the NAME column.

- rows containing TestPortletWindow in the NAME column.

### 4.1.4. CMS

In JBoss Portal 2.6 versions, the way the CMS content is displayed changed significantly. For further information, refer to Chapter 9, Content Integration and Chapter 21, CMS Portlet. Currently there is no need to have more than one instance of the CMSPortlet. The portlet window displays CMS content, not by referring to that portlet instance, but by having the proper content-type defined. The following configuration is in the `jboss-portal.sar/conf/data/default-object.xml` file:

    <window>
    	<window-name>CMSWindow</window-name>
    	<content>
    		<content-type>cms</content-type>
    		<content-uri>/default/index.html</content-uri>
    	</content>
    	<region>center</region>
    	<height>1</height>
    </window>

The following example uses the MySQL Query Browser. Open the JBP_OBJECT_NODE table in your database schema. Look at the PATH column to identify any occurrences of CMS in your JBoss Portal deployment. Identify any row referring to CMSPortletWindow, and remember the number in the PK column. The PK number is needed in the following steps:

Go to the JBP_WINDOW table and find a row with the same PK value from the JBP_OBJECT_NODE table. In such a row, replace CMSPortletInstance with a path to your CMS resource. For example, by default, JBoss Portal displays `/default/index.html`.

Add a row containing the following to the JBP_PORTAL_OBJECT_PROPS table:

- The PK number remembered from the OBJECT_KEY column.

- portal.windowContentType in the NAME column.

- cms in the jbp_VALUE column.

As well, the CMS can be migrated by backing up the `jbp_cms_*` tables, and recreating them in a JBoss Portal 2.6 database. There were no schema changes for the CMS between JBoss Portal 2.4 and JBoss Portal 2.6.

### Portlet Content-type and the path to the CMS Resource

The Admin portlet can be used to change the portlet window content-type, and configure the path to the CMS resource.

Prev | Up | Next
Chapter 3. Customizing your Installation | Home | Chapter 5. Portlet Primer