Upgrading LAMS 2.3.5 to 2.4 Linux

Before performing any upgrades, please make sure all your data is backed up properly in case you need to revert to previous versions.

This instructions are for a manual upgrade from LAMS 2.3.5 to 2.4 in Linux.

Stop your LAMS 2.3.5 server

Find the LAMS 2.3.5 server process and kill it

[root@c5 ~]# ps -ef|grep jboss
root      3497  3491 90 14:01 pts/0    00:00:14 /usr/lib/jvm/jdk1.6.0_35//bin/java -server -Xmx512m -XX:MaxPermSize=128m -XX:MaxNewSize=204m -XX:SurvivorRatio=32 -Dprogram.name=run.sh -Djava.endorsed.dirs=/usr/local/jboss-4.0.2/lib/endorsed -classpath /usr/local/jboss-4.0.2/bin/run.jar:/usr/lib/jvm/jdk1.6.0_35//lib/tools.jar org.jboss.Main
root      3530  1712  0 14:01 pts/0    00:00:00 grep jboss
[root@c5 ~]# kill 3497
[root@c5 ~]# ps -ef|grep jboss
root      3591  1712  0 14:02 pts/0    00:00:00 grep jboss
[root@c5 ~]# 

Read the /etc/lams2/lams.properties

The lams.properties file contains all of the settings that we will need to upgrade LAMS and it should look something like this:


[root@c5 ~]# more /etc/lams2/lams.properties 
#   Copyright (C) 2008 LAMS Foundation (http://lamsfoundation.org)
#   License Information: http://lamsfoundation.org/licensing/lams/2.0/
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License version 2.0 
#   as published by the Free Software Foundation.
# 
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
# 
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
#   USA
# 
#   http://www.gnu.org/licenses/gpl.txt 
#

#########################################################################################
# Installation Options									#
#########################################################################################

# The lamshome directory, will contain repository, temp and dump files
# Make sure this location has sufficient disk space as several files will be stored
# here during run time
LAMS_DIR=/var/opt/lams

# Username and password for the system admin for LAMS
LAMS_USER=sysadmin
LAMS_PASS=sysadmin

# Default language locale and text direction for LAMS, see section 3 of the readme
LOCALE=en_AU
LOCALE_DIRECTION=LTR


# Database name, username and password for your LAMS database
DB_NAME=lams2
DB_USER=lamsuser
DB_PASS=lamsdemo


# Wildfire configuration, used for chat tools. see the documentation under 
# "Configuring the Chat Server" at:
# http://wiki.lamsfoundation.org/display/lams/Building+LAMS
WILDFIRE_DOMAIN=localhost
WILDFIRE_CONFERENCE=conference.localhost
WILDFIRE_USER=admin
WILDFIRE_PASS=

#########################################################################################



#########################################################################################
# Essential Settings                                                                    #
# These setting must be correct in order for the install to complete successfully       #
#########################################################################################

# The port through which you want jboss to run
LAMS_PORT=8080

# The url you intend to use to run LAMS
# NOTE: Make sure the URL ends with a "/" or you will have problems running LAMS
SERVER_URL=http://50.97.148.3:8080/lams/

# Where your home directory of JBoss is
# This will contain your LAMS installation
JBOSS_DIR=/usr/local/jboss-4.0.2

# The directory that contains your JDK. (Must be 1.5 or higher)
JDK_DIR=/usr/lib/jvm/jdk1.6.0_35/

# The location of your mysql executable (Must be 5.0 or higher)
SQL_DIR=/usr/bin

# The location of your MySql server, leave as localhost unless you are useing MySql on
# a separate server
SQL_HOST=localhost

# The port that your MySql server is running through
SQL_PORT=3306

# The URL that your jdbc driver will be running through
SQL_URL=jdbc:mysql://${SQL_HOST}:${SQL_PORT}/${DB_NAME}?characterEncoding=utf8&autoReconnect=true

# The root password to access the database
DB_ROOT_PASSWORD=

#########################################################################################

#########################################################################################
# Installation Settings                                                                 #
# DO NOT CHANGE unless you require more disk space for repository, temp or dump dir     #
#########################################################################################

# Locations of the repository, temporary, and dump directories
# Used as storage locations for LAMS files
REPOSITORY_DIR=${LAMS_DIR}/repository
TEMP_DIR=${LAMS_DIR}/temp
DUMP_DIR=${LAMS_DIR}/dump

# Execution directories must be within the jboss-4.0.2 directory structure
BINDIR=${JBOSS_DIR}/bin
SERVER_DIR=${JBOSS_DIR}/server
DEFAULT_DIR=${SERVER_DIR}/default
DEPLOY_DIR=${DEFAULT_DIR}/deploy
EAR_DIR=${DEPLOY_DIR}/lams.ear
TOMCATDIR=${DEPLOY_DIR}/jbossweb-tomcat55.sar

# Location of installation files within the package 
LAMS_BUILD=${basedir}/lams_build
CONF_DIR=${basedir}/conf/unix
JBOSS_CONF=${CONF_DIR}/jboss
AUTH_CONF=${CONF_DIR}/authentication

# Drivers for MySql during installation
SQL_DRIVER=com.mysql.jdbc.Driver
SQL_JAR=mysql-connector-java-5.0.8-bin.jar

# The URL of the default mysql database
MYSQL_DB_URL=jdbc:mysql://${SQL_HOST}:${SQL_PORT}/mysql?characterEncoding=utf8

# The version of this lams installer
LAMS_VERSION=2.3.5
#########################################################################################

You might have modified this file according to your previous installation needs. Just make sure you keep this file handy as we will use some of these settings for the upgrade.

Download the LAMS v2.4 upgrade file

root@c5 tmp]# cd
[root@c5 ~]# cd /tmp
[root@c5 tmp]# wget http://downloads.lamsinternational.com/2.4/stable/unix/lams-unix-upgrade-2.4.0.tar.gz
--2012-08-30 16:27:02--  http://downloads.lamsinternational.com/2.4/stable/unix/lams-unix-upgrade-2.4.0.tar.gz
Resolving downloads.lamsinternational.com... 74.52.89.34
Connecting to downloads.lamsinternational.com|74.52.89.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 96018674 (92M) [application/x-gzip]
Saving to: `lams-unix-upgrade-2.4.0.tar.gz' saved [96018674/96018674]


100%[=============================================================================>] 96,018,674  11.1M/s   in 8.2s    

2012-08-30 16:27:11 (11.2 MB/s) - `lams-unix-upgrade-2.4.0.tar.gz

[root@c5 tmp]# tar xzf lams-unix-upgrade-2.4.0.tar.gz
[root@c5 tmp]# cd lams-unix-upgrade-2.4.0

Copy the new jboss-5.1 folder to /usr/local

[root@c5 lams-unix-upgrade-2.4.0]# cp -rp jboss-5.1 /usr/local
[root@c5 lams-unix-upgrade-2.4.0]# 

Copy 2.3.5 files to 2.4

There are some files that you need to copy as follow. In your lams.properties you'll find where jboss-4.0.2 is installed (as you can see above, it my case is JBOSS_DIR=/usr/local/jboss-4.0.2).

Copy uploaded files

[root@c5 ~]# unalias cp
[root@c5 ~]# cp -rf /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/lams-www.war/secure /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-www.war/
[root@c5 secure]# 

Copy news.html file

[root@c5 jboss-4.0.2]# cp -rf /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/lams-www.war/news.html /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-www.war/news.html 
[root@c5 jboss-4.0.2]# 

Copy Pixl folder pics

[root@c5 jboss-4.0.2]# cp -rf /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/lams-www.war/images/pixlr /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-www.war/images/
[root@c5 jboss-4.0.2]# 

Create a user you will use to run LAMS as

Previews versions of LAMS run it as root, which is not a really good idea. So for 2.4, we create a user called lams instead.

useradd -d /usr/local/jboss-5.1/bin -M lams 

set the permission for jboss-5.1 folder:

[root@c5 lams-installer]# chown -R lams:lams /usr/local/jboss-5.1 
[root@c5 lams-installer]# 

and also the other directories that LAMS uses, in my case the "LAMS_DIR=/var/opt/lams" as it shows in my lams.properties file

[root@c5 lams-installer]# chown -R lams:lams /var/opt/lams 
[root@c5 lams-installer]# 

Edit mysql connector

Edit the /usr/local/jboss-5.1/server/default/deploy/mysql-ds.xml file and enter the db name, user and password as configured in your lams.properties file

DB_NAME=lams2
DB_USER=lamsuser
DB_PASS=lamsdemo

...
    <connection-url>jdbc:mysql://localhost:3306/lams2</connection-url>
...
    <user-name>lamsuser</user-name>
    <password>lamsdemo</password>
...

Deploy new tools.

LAMS 2.4 has three new tools: Wookie, IMS Common Cartridge/Basic LTI and Webconferencing.

Go to your lams-unix-upgrade-2.4.0 folder and find the _new-tools_folder.

In there you should be able to see:

[root@c5 lams-unix-upgrade-2.4.0]# ls -l
total 16
drwxr-xr-x 2 root root 4096 Aug 30 11:59 extras
-rw-r--r-- 1 root root  161 Aug 30 12:00 instructions.txt
drwxr-xr-x 6 root root 4096 Aug 30 09:00 jboss-5.1
drwxrwxr-x 6 root root 4096 Aug 30 15:40 new-tools
[root@c5 lams-unix-upgrade-2.4.0]# cd new-tools/
[root@c5 new-tools]# ls -l
total 16
drwx------ 5 root root 4096 Aug 30 15:50 bbb-deploy
drwx------ 4 root root 4096 Aug 30 15:55 imscc-deploy
drwx------ 2 root root 4096 Aug 30 15:40 lib
drwx------ 5 root root 4096 Aug 30 15:56 wookie-deploy
[root@c5 new-tools]# 

Get into bbb-deploy and configure the deploy.xml file. If you left all the settings by default, you shouldn't need to do anything here. However, if you have changed settings, then you'll need to edit a few lines in there with the settings you have in lams.properties.

Once you know everything is alright, then execute the deploy.sh script and you should get the following output:

[root@c5 new-tools]# cd bbb-deploy/
[root@c5 bbb-deploy]# ./deploy.sh 
Starting Tool Deploy
Reading Configuration File ./deploy.xml
========Object Properties=======
DbUsername: lamsuser
DbPassword: lamsdemo
DbDriverClass: com.mysql.jdbc.Driver
DbDriverUrl: jdbc:mysql://localhost:3306/lams2?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useUnicode=true
LanguageFilesPackage: org.lamsfoundation.lams.tool.bbb
LamsEarPath: /usr/local/jboss-5.1/server/default/deploy/lams.ear
Tool Signature: labbb10
Tool Version: 20110511
Hide Tool: false
ToolWebUri: lams-tool-labbb10.war
ToolContext: /lams/tool/labbb10
ToolUpdateScriptPath: sql/updateTo20110511.sql
ToolInsertScriptPath: sql/tool_insert.sql
ToolLibraryInsertScriptPath: sql/library_insert.sql
ToolActivityInsertScriptPath: sql/activity_insert.sql
ToolTableScriptPath: sql/create_lams_tool_bbb.sql
ToolTableDeleteScriptPath: sql/drop_lams_tool_bbb.sql
ToolDBVersionScriptPath: sql/db_version_insert.sql
ToolApplicationContextPath: /org/lamsfoundation/lams/tool/bbb/bbbApplicationContext.xml
ToolJarFileName: lams-tool-labbb10.jar
MinServerVersionNumber: 2.2
DeployFiles: lams-tool-labbb10.war
DeployFiles: lams-tool-labbb10.jar
LanguageFiles: language/ApplicationResources.properties
LanguageFiles: language/ApplicationResources_el_GR.properties
LanguageFiles: language/ApplicationResources_en_AU.properties
LanguageFiles: language/ApplicationResources_es_ES.properties
LanguageFiles: language/ApplicationResources_es_MX.properties
LanguageFiles: language/ApplicationResources_fr_FR.properties
LanguageFiles: language/ApplicationResources_no_NO.properties
The tool to be installed: labbb10 does not exist in database
Continuing with full install
Running Tool DB Deploy
Deploying files to ear
Copying file language/ApplicationResources.properties to /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-dictionary.jar/org/lamsfoundation/lams/tool/bbb
Copying file language/ApplicationResources_el_GR.properties to /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-dictionary.jar/org/lamsfoundation/lams/tool/bbb
Copying file language/ApplicationResources_en_AU.properties to /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-dictionary.jar/org/lamsfoundation/lams/tool/bbb
Copying file language/ApplicationResources_es_ES.properties to /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-dictionary.jar/org/lamsfoundation/lams/tool/bbb
Copying file language/ApplicationResources_es_MX.properties to /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-dictionary.jar/org/lamsfoundation/lams/tool/bbb
Copying file language/ApplicationResources_fr_FR.properties to /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-dictionary.jar/org/lamsfoundation/lams/tool/bbb
Copying file language/ApplicationResources_no_NO.properties to /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-dictionary.jar/org/lamsfoundation/lams/tool/bbb
Writing out doc [#document: null]
Activating Tool: labbb10
Tool Deployed
[root@c5 bbb-deploy]# cd ../

Do the same for the other two tools imscc-deploy and wookie-deploy.

If all outputs look like the one above, you have deployed all new tools properly!

Manual db configuration update

There's only one small configuration update you will need to do manually on the database and it goes like this:

[root@c5 tmp]# mysql -u lamsuser -plamsdemo lams2
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 38
Server version: 5.0.95 Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> update lams_configuration set config_value = '/usr/local/jboss-5.1/server/default/deploy/lams.ear' where config_key = 'EARDir';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> exit
 

Now you are ready to start LAMS 2.4!

Start LAMS 2.4

When starting LAMS 2.4 for the first time, you will be able to see that LAMS runs quite a few db upgrade scripts automatically. So this first LAMS 2.4 boot might take a bit longer than usual. However, if you see the output without any errors, you have successfully upgraded LAMS 2.4!


[root@c5 bin]# su - lams -c "/usr/local/jboss-5.1/bin/run.sh -b 50.97.148.3"
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /usr/local/jboss-5.1

  JAVA: java

  JAVA_OPTS: -Dprogram.name=run.sh -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true

  CLASSPATH: /usr/local/jboss-5.1/bin/run.jar

=========================================================================

15:28:16,574 INFO  [ServerImpl] Starting JBoss (Microcontainer)...
15:28:16,575 INFO  [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)
15:28:16,575 INFO  [ServerImpl] Bootstrap URL: null
15:28:16,575 INFO  [ServerImpl] Home Dir: /usr/local/jboss-5.1
15:28:16,576 INFO  [ServerImpl] Home URL: file:/usr/local/jboss-5.1/
15:28:16,576 INFO  [ServerImpl] Library URL: file:/usr/local/jboss-5.1/lib/
15:28:16,576 INFO  [ServerImpl] Patch URL: null
15:28:16,577 INFO  [ServerImpl] Common Base URL: file:/usr/local/jboss-5.1/common/
15:28:16,577 INFO  [ServerImpl] Common Library URL: file:/usr/local/jboss-5.1/common/lib/
15:28:16,577 INFO  [ServerImpl] Server Name: default
15:28:16,577 INFO  [ServerImpl] Server Base Dir: /usr/local/jboss-5.1/server
15:28:16,577 INFO  [ServerImpl] Server Base URL: file:/usr/local/jboss-5.1/server/
15:28:16,577 INFO  [ServerImpl] Server Config URL: file:/usr/local/jboss-5.1/server/default/conf/
15:28:16,577 INFO  [ServerImpl] Server Home Dir: /usr/local/jboss-5.1/server/default
15:28:16,577 INFO  [ServerImpl] Server Home URL: file:/usr/local/jboss-5.1/server/default/
15:28:16,578 INFO  [ServerImpl] Server Data Dir: /usr/local/jboss-5.1/server/default/data
15:28:16,578 INFO  [ServerImpl] Server Library URL: file:/usr/local/jboss-5.1/server/default/lib/
15:28:16,578 INFO  [ServerImpl] Server Log Dir: /usr/local/jboss-5.1/server/default/log
15:28:16,578 INFO  [ServerImpl] Server Native Dir: /usr/local/jboss-5.1/server/default/tmp/native
15:28:16,578 INFO  [ServerImpl] Server Temp Dir: /usr/local/jboss-5.1/server/default/tmp
15:28:16,578 INFO  [ServerImpl] Server Temp Deploy Dir: /usr/local/jboss-5.1/server/default/tmp/deploy
15:28:17,121 INFO  [ServerImpl] Starting Microcontainer, bootstrapURL=file:/usr/local/jboss-5.1/server/default/conf/bootstrap.xml

...

15:29:18,786 INFO  [PatchTable] Created patch record for lawook10
15:29:18,874 INFO  [MigrationProcess] No patch tasks were discovered in your classpath. Run with DEBUG logging enabled for patch task search details.
15:29:18,874 INFO  [MigrationProcess] System up-to-date.  No patch tasks will execute.
15:29:18,874 INFO  [MigrationProcess] System up-to-date.  No patch tasks executed.
15:29:18,874 INFO  [MigrationProcess] Running post-patch tasks...
15:29:18,874 INFO  [MigrationProcess] No patch tasks were discovered in your classpath. Run with DEBUG logging enabled for patch task search details.
15:29:18,874 INFO  [MigrationProcess] No post-patch tasks found.
15:29:18,875 INFO  [JdbcMigrationLauncher] Executed 0 patches for context DataSourceMigrationContext[DatabaseType mysql/lawook10/org.jboss.resource.adapter.jdbc.WrapperDataSource@27bf353c]
15:29:18,875 INFO  [AutoPatchService] Applied 0 patches.
15:29:18,875 INFO  [ContextLoader] Root WebApplicationContext: initialization completed in 95 ms
15:29:18,893 INFO  [TilesPlugin] Tiles definition factory loaded for module ''.
15:29:18,893 INFO  [Dispatcher] Connector initialized to net.fckeditor.connector.impl.ContextConnector
15:29:18,901 INFO  [TomcatDeployment] deploy, ctxPath=/lams/www
15:29:18,932 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-50.97.148.3-8080
15:29:19,044 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-50.97.148.3-8009
15:29:19,152 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 1m:2s:572ms


For further details, please check out the Sysadmin Guide

Need help?

Check out the technical forums in the LAMS Community