Upgrading to new versions of Alfresco

You can consider upgrading to a new 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 listed earlier, sometimes you might consider upgrading to a newer version, as you do not want to maintain 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, it might be very expensive for you to upgrade later on. This is the scenario with most enterprise software.

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

Upgrading to a minor release

An Alfresco minor (or dot) release typically contains bug fixes and minor enhancements. There will not be any new features. An example is upgrading from Alfresco 3.2 to 3.2.1 release.

Since there are no new features, typically, the database schema remains the same. In this situation, you can replace only the web application (WAR) file to upgrade.

The WAR file (alfresco.war) for Tomcat installation is located in the<install_folder>/tomcat/webapps folder.

Follow these steps for minor upgrades:

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

Test your application after upgrading it to ensure that the upgrade is successful.

Upgrading to a major release

An Alfresco major release typically contains new features, performance enhancements, and bug fixes. An example is upgrading from Alfresco 2.x to 3.x releases.

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 do manual upgrades any more.

For example, let us assume that you are using the Tomcat bundle of Alfresco 2.1 (installed in C:alfresco2.1 folder) on a Microsoft Windows operating system, and you want to upgrade to Alfresco 3.3 release.

Follow these steps for major upgrades:

  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).
  3. Download the complete Alfresco package, Tomcat bundle for the Microsoft Windows operating system.
  4. Perform a new installation in a different folder (say C:alfresco3.3).
  5. Copy the older Alfresco file content folder to the newer installation (copy the C:alfresco2.1alf_data folder to C:alfresco3.3alf_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.

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

There are some configuration files and a properties file in Alfresco's config folder (/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/), which you might have updated, which require manual updates.

While I was writing this book, I upgraded the example application from Alfresco 2.1 version to Alfresco 3.3 version. I used the following script to restore some of the customization files. I manually updated some of the configuration files. Refer to the batch file that 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 to build and deploy the customization files to the newer installations.

Test your application after upgrading it to ensure that the upgrade is successful.

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

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