Team,
Here are some more details on how to work with Liferay's patching tool.
Patching Liferay with the patching-tool
Setup your environment
Download the latest patching-tool from liferay.com's Portal
- mv any existing patching-tool directory
cd /home/liferay/bundles/liferay-portal-6.2-ee-sp7
mv patching-tool/ patching-tool.17
- Expand the latest patching tool into your liferay's root directory
cd /home/liferay/bundles/liferay-portal-6.2-ee-sp7
jar -xvf ~/Downloads/patching-tool-20.zip
- Copy any installed patches into the new patching-tool/patches directory
cd /home/liferay/bundles/liferay-portal-6.2-ee-sp7/patching-tool/patches
cp -R ../../patching-tool.17/patches/* .
- Make sure that the portal is stopped.
- Update the patching tool so it understands your environment:
cd /home/liferay/bundles/liferay-portal-6.2-ee-sp7/patching-tool/
./patching-tool.sh auto-discovery
Download the Service Packs
- Download the latest service-pack or fix packs -- note that the service packs are cumulative, so there is no need to go back and get older versions.
- Copy the downloaded service packs and fix pack zip files to the"patching-tool/patches" directory.
Installing Patches (binary)
- Run the patching tool with the "info" arguement to see what it will do:
./patching-tool.sh info
./patching-tool.sh install
Cleaning up: [....................]
Installing patches: [....................]
Syncing...
WARNING: Plugins and patches are modifying the same files. Please run
"patching-tool list-collisions" to review the possible collisions.
The patches contain new database indexes compared to the original version. Run
the patching tool with the index-info parameter for more information.
Some of the plugins has an outdated version of the patched libraries. Please
run the patching-tool with the update-plugins parameter to update the
libraries in the deployed plugins.
The installation was successful. One patch is installed on the system.
Collisions
- If there are any collisions run the following to see what files need to be inspected manually. In our case I have seen that we are hooking a couple ofjsp files that need to be updated within our hook.
./patching-tool.sh list-collisions
Listing collisions (file, plugin, patch):
html/portlet/dockbar/view_user_account.jspf, Notifications EE Portlet,
portal-48
html/portlet/my_sites/view.jsp, vlcs Hook, portal-48
html/portlet/login/login.jsp, vlcs Hook, portal-48
- In this case it appears that new database indexes are needed. To find out more information run the patching tool with the "index-info" option:
./patching-tool.sh index-info
# Patching tool index information
#
# Some portal patches create new indexes in the database. As there is no
# database connection at patching time the patches needed to be created at
# portal startup. In order to get the indexes automatically created, please
# add
# the following line to the portal-ext.properties file if the server has
# permissions to modify the indexes in the database:
#
# database.indexes.update.on.startup=true
#
# In case this does not work in your environment, the indexes can be created
# manually. These are the indexes which should be created (compared to the
# original portal version):
# portal-48:
create index IX_1B352F4A on DLFileEntry (repositoryId, folderId);
create index IX_FF0E7A72 on JournalArticle (classNameId, templateId);
create index IX_64CCB282 on WikiPage (nodeId, head, redirectTitle);
I have added this property to portal-ext.properties
Working with Source Patches
Use the patching-tool to patch your liferay source code as well to make sure that the source is in sync with your runtime system. This is important if you need to debug the code.
- Run patching-tool.sh install with the default.properties patching.mode=source
Download Source Patches
- You need to download the fixpack with source and copy these files into the patching-tool/patches directory.
- Set the mode, add jdk.version, and source.path within
default.properties
.
#patching.mode=binary
patching.mode=source
jdk.version=jdk7
war.path=../tomcat-7.0.42/webapps/ROOT/
global.lib.path=../tomcat-7.0.42/lib/ext/
auto.update.plugins=true
source.path=/home/liferay/portal_source/liferay-portal-src-6.2-ee-sp8
Run the patching-tool just like above to "install" the patches. This will go into your source code as defined by "source.path" and update the code to match the binary code. Make sure that you have also downloaded the binary service packs and patched your system with the setting set to "binary" as documented right above within default.properties.
Ken