Upgrading to newer versions of Alfresco

You can consider upgrading to a newer version of Alfresco if you are expecting one of the following benefits:

  • Security patches
  • Bug fixes
  • New features
  • Compatibility with other systems

Even if you are not getting the benefits that are listed above, sometimes you might consider upgrading to a newer version, so that you do not have a big gap between the Alfresco version on which your application is currently running, and the latest Alfresco version. If this gap is too big, then it might be very expensive for you to upgrade later on. This is the scenario with most enterprise software.

Alfresco has an upgrade script feature that helps you to upgrade to newer versions automatically. However, it is essential to follow the best practices when upgrading your system. Always try upgrading your test or staging server first, before trying to upgrade the production server. It is essential that you back up your existing data before attempting an upgrade. Follow the information and the instructions given in the Data Backup section.

Upgrading to a minor release

Typically, an Alfresco minor (or dot) release contains bug fixes and minor enhancements. There will not be any new features. An example is upgrading from Alfresco 3.0 to 3.0.1 release.

Because there are no new features, the database schema remains the same. In this situation, you can replace only the web application (.war) file in order to upgrade.

The WAR file (alfresco.war) for a Tomcat installation is located in the <install_folder> omcatwebapps folder.

Carry out the following steps to perform a minor upgrade:

  1. Download the latest alfresco.war file from the Alfresco web site.
  2. Stop Alfresco.
  3. Back up all of the data, including the customization files (as explained in the earlier sections of this chapter).
  4. Delete the web application folder, <install_folder> omcatwebappsalfresco.
  5. Replace the alfresco.war file, in the <install_folder> omcatwebapps folder, with the latest one.
  6. Restore the customization files.
  7. Start Alfresco.

Test your application after upgrading it, in order to ensure that the upgrade was successful.

Upgrading to a major release

Alfresco's major releases typically contain new features, performance enhancements, and bug fixes. An example is upgrading from Alfresco 2.x to the 3.0 version.

The upgrade scripts will be executed automatically by the server, when starting up against an existing database. Scripts that support the various hibernate dialects can be found in the <configRoot>/alfresco/dbscripts/upgrade/* folders. This means that you don't have to perform manual upgrades anymore.

For example, let us assume that you are using a Tomcat bundle of Alfresco 2.1 (installed in the C:alfresco2.1 folder) on your Windows operating system, and you want to upgrade to the Alfresco 3.0 release. In this case, you would carry out the following steps:

  1. Stop Alfresco in your current installation folder, C:alfresco2.1.
  2. Back up all of the data, including customization files (as explained in the earlier sections of this chapter).
  3. Download the complete Alfresco package and the Tomcat bundle for the Windows operating system.
  4. Perform a new installation in a different folder (say, C:alfresco3.0).
  5. Copy the older Alfresco file content folder to the newer installation (copy C:alfresco2.1alf_data folder to C:alfresco3.0alf_data).
  6. Create a new database table, and restore the relational database content from the older database. Update the Alfresco configuration file in the new installation, to point to this new database.
  7. Restore the customization files in the new installation.
  8. Start Alfresco in the new installation.

Although most of the upgrade happens automatically, you might have to perform some manual steps in order to restore your customization files in the new installation.

There are some configuration files and a properties file in Alfresco's config folder ( omcatwebappsalfrescoWEB-INFclassesalfresco), which you might want to update, that requires manual updates.

While I was writing this book, I upgraded the sample application from the Alfresco 2.1 version to the Alfresco 3.0 version. I used the following script to restore some of the customization files. I then manually updated some of the configuration files. Refer to the following batch file, which I used to restore the customization files on the Windows platform:

rem -----------------------------------------------------------------
rem Replaces/Adds Alfresco Custom Files to new Alfresco installation
rem -----------------------------------------------------------------
set L_LOCALDIR=%CD%
set L_SRCDIR=C:alfresco_book_21
set L_DESTDIR=C:alfresco_book_30
rem ------------ Replace Logos ----------------
CD %L_DESTDIR%	omcatwebappsalfrescoimageslogo
move AlfrescoLogo32.png AlfrescoLogo32.png-ORIGINAL
move AlfrescoLogo200.png AlfrescoLogo200.png-ORIGINAL
move AlfrescoFadedBG.png AlfrescoFadedBG.png-ORIGINAL
copy %L_SRCDIR%	omcatwebappsalfrescoimageslogoAlfrescoLogo32.png .
copy %L_SRCDIR%	omcatwebappsalfrescoimageslogoAlfrescoLogo200.png .
copy %L_SRCDIR%	omcatwebappsalfrescoimageslogoAlfrescoFadedBG.png .
rem ------------ Copy files in extension folder ----------------
CD %L_DESTDIR%	omcatsharedclassesalfrescoextension
copy %L_SRCDIR%	omcatsharedclassesalfrescoextensioncustom-model-context.xml .
copy %L_SRCDIR%	omcatsharedclassesalfrescoextensioncustomModel.xml .
copy %L_SRCDIR%	omcatsharedclassesalfrescoextensionweb-client-config-custom.xml .
CD %L_LOCALDIR%
echo I am done...
pause

You can create your own batch scripts to automatically restore your customization files. Typically, most of the developers use tools such as Eclipse for building and deploying the customization files to newer installations.

Test your application after upgrading it, in order to confirm that the upgrade was successful.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset