Posts Tagged ‘Liferay upgrade 6.0.x to’

With working experience of Liferay from EE to, found following problems and issues.

Before understanding how to upgrade, it will helpfull to understand how Liferay upgrade works.

Liferay upgrades its database with one by one, like if you are using and if you are upgrading to then, flow will look like below example

  1. 6.0.6 to 6.0.11
  2. 6.0.11 to 6.0.12
  3. 6.0.12 to 6.1.0
  4. 6.1.0 to 6.1.1
  5. And finally 6.1.0 to 6.2.0

so it means that, so in beteen if it fails, your database is partially upgraded. I mean, let say if it throws error/Exception, yes there can be exceptions. So in those cases, your database is half upgraded and you might require some Liferay patch or some other problem in your database, which you need to take care accordingly and start again same process from your restoring backedup database to your upgrade instance and try fixing the error.

Now how it performs this upgrade, Liferay contains some jar with version, and version executor, so once you start upgrade ,it automatically picks up existing version and start upgrading to latest before starting. And this contains All indivisuall class like ImageLibrary upgrader or DL Upgrader with or without database sql scripts for each individual version. And thats it. So if you see any exception, you can decompile jar and see what is causing this problem.

So here we go for upgrade steps. 

  1. Code Migration: Here what i mean is you need to upgrade 4 things. 
    1. Get latest version Portal zip
    2. Custom portlets/hooks: Code need to upgraded with compatibility with latest version. This can be done via command line with ant upgrade option or manually updating portlet.xml and other config files.
    3. Ext: Here full Ext code need to be reviewed and validated according to any Kernel api changes. And it might happen that, you can achieve same functionality with Hooks, then design with Hooks.
    4. Service: If you have any service generated for any portlet/hook/ext, you need to regenerate service code again updating your old service xml file with minor new service modification(xsd and if any field update) . You might not be able to use old service as is.
  2. Data Migration
    1. Liferay made this process pretty easy.Liferay provides 2 kind of bundles zip for your latest version, you might need to get someintrim version upgrade, if youdont find direct upgrade links between your version to new version
      1. Liferay upgrade zip or
      2. Liferay Portal zip
    2. New Version licence file.
    3. Now you just need to unzip file and update portal-ext with your database instance, jackrabbit or anything and start upgrading.

Production Infrastructure. 

  1. 5 Apache with Loadbalancer, Siteminder Agent
  2. 5 Liferay Application Server
  3.  1 Solr server+1 Coveo Server for Search integration
  4. 1 Database Server MS Sql Server 2008 R2
  5. Configuration
    1. Jackrabbit data store  integration with MS SQL Server
    2. Siteminder SSO

Pre-deployement steps

If you are already read about above steps. Then it is pretty easy job for you.

  1. Download latest version Portal/upgrade zip
  2. Get latest version License
  3. Unpack/unzip your portal/upgrade zip.
  4. Create in portal[version]/tomcat[version]/ROOT/WEB-INF/classes with adding database information and enabling Jackrabbit settings, if you are using jackrabbit repository.
  5. Add repository.xml in portal[version]/data/jackrabbit/
  6. Add license.xml file in portal[version]/deploy folder.
  7. Install any Fix pack/patch required for upgrade. (This will be required, if there are patches which liferay have released or you have some issue and found some patch). If you dont know how to install patches, liferay have good amount of documentation.
  8. clean up your solr and Lucene instance data folders if any.
  9. And make sure you have your lportal database and lportal_doc (jackrabbit) database backed up properly, you might need to rerun your this same upgrade process.
  10. Tune your JVM for highest performance based on your server architecture.
  11. Things not to do. 
    1. No need to deploy your custom portlet/hooks/ext except image gallary/document library hook  before upgrade
    2. No need to copy any other marketplace portlet for now.
    3. No one is accessing/using your database during deployement steps
    4. All Liferay servers are stopped, and no one is accessing your database. You can actually confirm same from DBA or looking in Database Server.
    5. Let your customer know that for some time period(based on your mock run time), there will be outage for that particular time.

Deployment Steps

1.  Here we go, just need to run portal server(portal/tomcat/bin/startup.[bat|sh]) or upgrade script.

2. You can monitor catalina.out log in portal/tomcat/log folder, it will show, which version,with which entity/portlet liferay currently running.

3. Once server is started successfully(you will see message), you can start validating basic things.


1. Under portal settings, you can validate your things.

2. Validate your data is successfully migrated. and is visible also

Post deployment Steps

1. Deploy your custom portlet, marketplace portlet, hooks, ext if any.

2. Configure solr, and run reindex from portal settings

You might need to follow this steps multiple time, ideally liferay say that it is seam less upgrade, but it might happen, you need patch to successfully run the upgrade. With our upgrade, we needed 2 to 3 patch to finish upgrade, and finally data was successfully upgraded