Liferay101: Putting portal-ext.properties under version control

Jason Knight and I are beginning to move towards implementing a production Liferay 6.0 Enterprise system. In this series of posts called “Liferay101”, I’ll document some of the steps that we are taking as Liferay newbies as we work towards completing this project.

One of the first things that we need to do is to put the all-important portal-ext.properties file under version control. The portal-ext.properties file controls most of the “run-time” customization of Liferay. There is some conflict as to the proper location of the portal-ext.properties file. We’ve chosen to follow Rich Sezov’s guidance in the Liferay Administration Guide and we’ve installed portal-ext.properties one level above the Tomcat application server’s home directory.

As we expect to be making significant changes to this file during this project, we need to place it under version control to make sure that we can recover from any mistakes that we make while editing it. At this point, this is the only file that needs to be under version control. The University provides us with a Subversion server, so that’s what we’re going to use for this project. Subversion is a directory oriented file management system, so we’re going to use it slightly differently. I’ve followed the excellent guidance in this article: “Version control of single files using Subversion” to configure subversion control of just a single file:

cd /opt/liferay-portal-6.0-ee-sp1
svn mkdir https://<our svn server>/repos/emorylaw/liferay_conf
svn co https://<our svn server>/repos/emorylaw/liferay_conf .
svn add portal-ext.properties
svn commit

This commits the current version of the portal-ext.properties file to the repository. From now on, whenever we want to work on the file, we can do something like this:

  • Check the status of the file to make sure that it’s the same as the version on the server: svn status portal-ext.properties
  • Assuming that the status is the same, make our edits to the file: vim portal-ext.properties
  • Commit the new changes to SVN server: svn commit portal-ext.properties

Of course, if it turns out there is an issue with our changes, we can revert to a previous version with “svn revert portal-ext.properties” and all of the other things that you can do with subversion.

Here are some other subversion resources:

Anyway, we hope this is helpful. Please let us hear from you if you have suggestions or comments. Stayed tuned for more Liferay101!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s