----
h1. Portal 3.0x Upgrade Guide
----
{cagridroundpanel}
{pre:class=cagridheaderfont}Table of Contents{pre}
{toc:outline=true|exclude=Portal 3.0x Upgrade Guide|style=none}
{cagridroundpanel}
h2. Introduction
This guide explains how to upgrade an existing caGrid Portal 2.2 installation to version 3.0x.
If you are running an earlier version (<3.0) of the portal, we recommend that you re-install the latest release using the instructions in the [installation guide|portal30:Installation Guide].
h2. Obtaining the caGrid Portal 3.0x Software
----
See [this section|portal30:Installation Guide#ObtainingthecaGridPortalSoftware] of the installation guide for instructions on how to obtain the caGrid Portal 3.0x software.
h2. Obtain Required Software

...

----
You must install the following software:
* Java 1.6.x
** Make sure JAVA_HOME is set and Java SDK executable is on the PATH.
* Ant 1.6.5
** Make sure that ANT_HOME is set and Ant executable is on the PATH.
h2. Update Properties
----
The caGrid Portal build script uses {{build-<target.env>.properties}} file for setting all its properties. By default the {{<target.env>}} is local, so if you don't provide a {{<target.env>}} when building the project (-Dtarget.env=) the {{build-local.properties}} file is used.
You can copy these property files from your existing portal installation or simply edit these properties for your environment.
{{<target.env>}} is the environment in which the portal is being installed. By default, the distribution of caGrid Portal is pre-configured for the following environments:
* nci_qa-1.3
* nci_stage-1.3
* nci_prod-1.3
* training-1.3 *(default)*
You can also get more details on individual properties [here|portal30:Installation Guide#ConfigurecaGridPortalInstallation]
{info:title=Note} The {{build-local.properties}} has a list of properties that are REQUIRED to configure the installation to the local environment (database connections settings etc.). Users are expected to fill in the appropriate values in the {{build-local.properties}} file.
{info}
{info:title=Note} Since this is an upgrade process, users can also re-use their existing {{build-<target.env>.properties}} file. In case you are re-using your existing properties file to configure the portal, it is important to note that some new properties have been introduced in this release.
{info}

...

{info:title=Important}
If you are using an existing JBoss, the property "liferay.jboss.home" is REQUIRED.
{info}
h2. Build the Portal Project
Since this is a source release, you will first need to build the software with ANT. To do so, run the following command:
{code}ant all{code}
h2. Upgrade caGrid Portal Software
----
h3. Change MySQL default engine to InnoDB
In "MySQL Administrator" tool set the "Default storage" option to be InnoDB as shown.
!mysql-admin.png|alt=Default storage must be InnoDB!
h3. Update all tables in lportal and portal2 to InnoDB
In "MySQL Administrator" tool select the "Catalogs" option on the left, select the "portal2" schemata and verify that all tables have the value "InnoDB" in the "Engine" column.
!mysql-admin-schema-tables.png|alt=All tables must be InnoDB!
If one or more tables have a different value right click on it and choose "Edit Table" from the context menu. In the dialog that will open select the "Table Options" tab. Select "InnoDB" as the "Table Engine".
!mysql-admin-edit-table.png|alt=Edit Table!
h3. Upgrade the Database
Run the following command to upgrade the database:
{code} ant update-schema {code}
{info:title=Note} The following log messages are normal. Wait till this process finishes on its own.
{code}
updateDatabase] Changeset cagrid_portal-db-20-changelog.xml::20-1::kherm (generated)

...

::(MD5Sum: ef6eecdf75d51e257c7060d2c7a0f46)
[updateDatabase] Marking ChangeSet: cagrid_portal-db-20-changelog.xml::20-1::kherm (generated)::
(MD5Sum: ef6eecdf75d51e257c7060d2c7a0f46) ran due to precondition failure:
[updateDatabase] Not precondition failed
{code}
{info}
h3. Upgrade the deployment
Do the following to upgrade caGrid Portal.
* Shut down JBOSS.
* Since this release of the caGrid Portal also updates the Liferay Portal software, you must delete your existing caGrid Portal and Liferay Portal installations from the JBOSS server. Typically you must delete the following directories (these paths may vary):
{code}
${JBOSS_HOME}/server/default/deploy/cagrid-minimal.war
${JBOSS_HOME}/server/default/deploy/cagridportlets.war
${JBOSS_HOME}/server/default/deploy/liferay-portal.war
{code}
* Delete all jar files from $JBOSS_HOME/server/default/lib/ext.
* Clean the JBOSS cache, i.e delete $JBOSS_HOME/server/default/tmp and $JBOSS_HOME/server/default/work directories.
* Run {{ant \-Dtarget.env=nci_dev install-liferay}}.
* Run {{ant \-Dtarget.env=nci_dev deploy-all-portlets}}.
* Run {{ant \-Dtarget.env=nci_dev config-trust}}.
* Start up JBOSS.
{info:title=Note}(-Dtarget.env) is the environment in which caGrid Portal is being installed.{info}
{info:title=Note} Wait for JBOSS server to restart and fully deploy the caGrid Portal (typically 5 minutes) before opening the portal homepage in the browser (for example, [http://localhost:8080]).
{info}

...

h2. Import the Site Structure
h3. Set Up the Guest Community Layout
Before performing the below steps, its a good idea to clear out the Portal caches. To do this, open the Control Panel (Go to http://<host>:<port>/group/control_panel) and select *Server Administration* and click the following
* Clear content cached by this VM"
* Clear the database cache.
* Reindex all search indexes.
!clear cache.png|alt=Clean Portal cache!
After cleaning the cache, see [this section of the Installation Guide|portal30:Installation Guide#ImporttheSiteStructure|Installation Guide] to import the site structure and set up the community layout.
h2. Set Up Site Privileges
See [this section of the Installation Guide|portal30:Installation Guide#SetUpPrivileges|Installation Guide] to set up site privileges.
Once this is done, give the same privileges to the existing users of the portal. To do this, open the Control Panel and select *Roles*.
!portal_cp_roles.png|alt=Roles Configuration.!

...
You will see the _Catalog User_ role created earlier. Click the *Actions* button and select *Assign Members*. The following window appears.
!portal_cp_roles_members.png|alt=Assign Members.!
Select the *Assign Members->Users->Available* tab. A list of all current portal users appears. Select all users (checkbox) and click *Update Associations*. This provides the _Catalog User_ privilege to all current users of the portal.
!portal_cp_roles_members_update.png|alt=Update Current Users.!
{info:title=Note} You may want to give the _Catalog Admin_ privilege to those users that need administration privileges on the portal.
{info}

...

h2. Refresh Lucene Index
Portal on start-up will re-load the SOLR/Lucene index. Post start up, its also recommended that you manually refresh the SOLR index by invoking the URL.
http://<hostname>:<port>/solr/dataimport?command=full-import
h2. Re-deploying
----
If you are merely redeploying the portal, which refreshes a Portal 3.x deployment, do the following.
# Shut down JBOSS/Tomcat.
# Delete the existing cagridportlets.war from JBOSS.
# Delete the existing solr.war from JBOSS.
# [Get the caGrid Portal source code|portal30:Installation Guide#ObtainingthecaGridPortalSoftware].
# [Update the properties|portal30:Upgrade Guide#UpdateProperties].
# Run the following ant steps from the $SRC folder:
{code}
ant -Dtarget.env=<target.env> all
ant -Dtarget.env=<target.env> deploy-all-portlets
{code}
# Start up JBOSS/Tomcat.
# [Refresh Lucene Index|portal30:Upgrade Guide#RefreshLuceneIndex].