« Back to Upgrade Instructions

Upgrade Instructions from 4.1 to 4.2

Upgrading an existing installation #

  1. Stop the application (app server or servlet container process)
  2. Backup the database! This is very important in case you need to revert back to your original setup and configuration!
  3. Run the upgrade SQL scripts for your database
  4. Substitute the existing installation
    1. If deploying using the bundle unzip to a new directory
    2. If deploying using the EAR substitute the existing one and update the dependent libraries in the global classpath
  5. If you modified the configuration through portal-ext.properties or sytem-ext.properties, copy the configuration from the old server to the new one
    1. You might have to adapt the configuration to the new version. Check the new versions of portal.properties and system.properties to see if any of the properties whose values you've overridden have changed.
  6. Run the server. The first time it should run the automatic Upgrade Processes (as can be seen in the logs)

Upgrading the extension environment #

  1. Download or update the sources
  2. Review release.${userName}.properties to make sure it points to your existing ext environment
  3. Make sure all your the files in the old ext environment are commited to your version control system. If you are not using one (which is strongly recommended) you should make a backup.
  4. For 4.2.1, run 'ant clean start build-ext'. For 4.2, run 'ant clean start start build-ext'.
    1. 'ant clean start build-ext' fails in 4.2; related LEP ticket
  5. You will notice that the updated extension environment has a new directory: ext-service, but that it's also missing some files. There is an LEP ticket relating to this which includes a fix.
    1. There's also a manual way of working around this problem: Copy files from source\tools\ext_tmpl\ext-service to ext\ext-service (build.xml and \src directory)
  6. Jar up ext-service. In the ext-service directory, run 'ant compile jar'
  7. Do an 'ant clean build-service' in ext\ext-ejb. (This is not a required step, but it is a good idea to change the DTD from 4.0.0 to 4.2.0 in your service.xml)
  8. Organize the imports of your java classes and jsp files to point to the correct paths. This is due to the re-packaging of some core classes and the upgrade of Spring 1.2.8 to 2.0.1. Many of your portlet classes will be located in \ext-service.
    1. When you change any impl classes, you should 'ant build-service' which will automatically fix the paths for other files
    2. This is very easy if using Eclipse.
      1. Modify your extension environment's Java build path to include ext-service (right-click on your EXT java project, properties, java build path, source tab)
      2. Click Add Folder, add ext\ext-service\src, click OK.
      3. Locate the files and do a control+shift+O. (shortcut for Organize Imports)
  9. Run 'ant compile' in ext-ejb to check for any compile errors. Once you successfully compile, run 'ant clean deploy' from \ext to deploy to your server.

Upgrading Themes #

See instructions to upgrade an existing theme.

Service Builder #

If you are using Service Builder to develop your own portlets you'll have to make some changes to adapt to the latest changes in the packaging of Liferay Portal.

We have refactored the services to allow portlet applications deployed as independent WARs to access the services created with Service Builder :) In order to achieve it we had to put all interfaces in the new portal-service.jar that has to be added to the global classpath of the application server.

Follow the following steps:

  1. Delete all autogenerated classes (packages ejb, http, persistance)
  2. Run ant build-service for your service
  3. Move the classes in the model package the model.impl package and rename them by appending Impl to the end of the class name. Also change it so that it inherits the new interface for that model class. For example if you had model.Account move it to model.impl.AccountImpl and make it inherit from model.Account (which is now autogenerated and placed in the top level ext-service directory)
  4. Run ant build-service for your service again to regenerate the service wrappers
  5. Perform a clean compilation

New chat portlet #

The old chat based on NFC has been removed and substituted with a new chat portlet that includes instant messaging functionality.

This new portlet does not offer yet chat room functionalities as the previous one, but this feature will be added in future versions.

The new portlet is based on AJAX and Jabber technologies instead of using a Java applet. It requires a wildfire server to work. Follow the instructions provided in Chat Portlet to install and configure it.

Misc items #

Note: Upgrading to 4.2 from versions below 4.1 #

You can Upgrade your EXT environment from x.x to 4.2 with one jump, for example upgrading version 3.6 to 4.2. But you need to make sure to use the database update scripts in increments.

Test your upgrade up with backups!!

Here is the migration path for a 3.6 to 4.2 update, which you could also apply to any general migrations:

Make backups of your database and EXT environment.

1. update portal source (in this case to 4.2)

2. run 'ant clean start build-ext' from the new source to update your EXT environment to the newest build

3. run the appropriate database upgrade scripts from 3.6 to 4.0, 4.0 to 4.1, 4.1 to 4.2. You can find the sql scripts for each release here: http://sourceforge.net/project/showfiles.php?group_id=49260&package_id=42607

4. upgrade the service layer. The service layer upgrade is specific to 4.2. Customizations to 4.2.x requires some extra steps. they may be found up top at "Upgrading the extension environment"

Changes in portlet and themes identifiers #

Since Liferay Portal v4.1.2 the ids of portlets and themes are manipulated before being written to the database. In particular, all characters that are not safe to be used in JavaScript scripts (spaces and minus signs) are removed. Liferay 4 include an upgrade script that modifies the database to change any old portlet or theme reference to conform to the new naming convention.

While the upgrade script should cover 99% of the situations there is 1% that is not covered that you should be aware of. If you are using custom layout templates that define columns whose names are not of the form column-N where N is a number from 1 to 10 then you should upgrade the portlets referenced from those columns yourself. In order to do so, review the typePreferences of entries of the Layout_ table that use the non-conforming layout template and edit its contents. You should keep the properties-like format and only change the portlet ids to remove the spaces and minus signs in the cases where they are used.

Modifications to liferay-portlet-ext.xml and liferay-display.xml #

Note that liferay-portlet-ext.xml and liferay-display.xml will not be overwritten.

(It is good practice to change the DTD in liferay-portlet-ext.xml from 4.0.0 to 4.2.0. The DTD for liferay-display.xml has not changed, so leave this at 4.0.0)

In liferay-portlet-ext.xml, you will need to change the <struts-path> of portlet 66 to "web_proxy".

Several new portlets have been added in Liferay 4.2. Since liferay-display.xml is not overwritten, these portlets will show up in the Undefined category. You can take a look at source/portal-web/docroot/WEB-INF/liferay-display.xml to see the default categories.

0 Attachments
Average (0 Votes)
The average rating is 0.0 stars out of 5.