alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

jforum example source code file (UpgradingFrom2.1.7To2.1.8.txt)

This example jforum source code file (UpgradingFrom2.1.7To2.1.8.txt) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - jforum tags/keywords

ajax, dwr, for, hsqldb, in, jforum, jforum, open, open, postgresql, the, the, upgrading, upgrading

The jforum UpgradingFrom2.1.7To2.1.8.txt source code

\\
[{Warning

Version 2.1.8 is not yet released
}]

!!! Upgrading from version 2.1.7 to 2.1.8

Upgrading from JForum version 2.1.7 to version 2.1.8 is easy. All you have to do is to carefully follow the steps here described. 

The suggested approach is to unpack JForum 2.1.8 into some temporary directory, make the steps here shown, and then, when all is finished and tested, copy it over the directory where the previous version is located. This is a suggestion, and you're free to proceed the way you prefer. 

! What's new
For a list of changes made in JForum 2.1.8, please check [New and Changed Features in JForum 2.1.8|New Features 2.1.8].

!! Backup your data
First, make a backup of the database and the current directory where JForum is installed. JForum's directories are: ''templates'', ''images'', ''upload'' and ''WEB-INF/config''. Each database has a different backup tool, so please check its documentation or with your system administrator. For HSQLDB backup, the database files are in the directory ''WEB-INF/config/database/hsqldb'', and all you have to do is to copy it. 

! Configuration files 
You'd like to take special care for ''SystemGlobals.properties'' and ''jforum-custom.conf'', as these are the main configuration files. Backup them and then compare and merge your current version with the new version that comes with JForum 2.1.8. The same is valid for database-specific configurations, that are stored in the directory ''WEB-INF/config/database''. 

!! Upgrading the database schema
There are some changes to the database schema - a new column here, a removed column there... In order to get the new database right, go to the directory __''upgrade/2.1.8''__, where you'll find the upgrade script for all supported databases - Oracle, MySQL, PostgreSQL and HSLQDB. 

Using your database management console / [tool|http://www.aquafold.com], import the appropriate script. Below is a list of commands for each database - another possible approach is to simple use the management console and paste the script there. It is up to you. 

! MySQL
''mysql -u USERNAME -p DBNAME < mysql_2.1.7_to_2.1.8.sql''

! PostgreSQL
Log in to postgres and type

''\i /path/to/postgresql_2.1.7_to_2.1.8.sql''

Or, directly from the command line, use the ''psql'' tool, as in

''psql -f /path/to/postgresql_2.1.7_to_2.1.8.sql''

! Oracle
''sqlplus @oracle_2.1.7_to_2.1.8.sql

! HSQLDB
The process for HSQLDB is trickier. First, from the command line, go to the directory ''WEB-INF/config/database/hsqldb'', which is where the database is located. Then, run the following command (you must have Java installed):

''java -Djava.ext.dirs=../../../lib org.hsqldb.util.DatabaseManagerSwing''

This will open a dialog window asking you for connection settings. In "Type" choose "HSQL Database Engine Standalone", and, for "URL", put the value ''jdbc:hsqldb:jforum''. Leave "User" and "Password" with the default values, and click "OK". A new window will show up, listing all tables in the left column. 

Now simply paste the contents of file hsqldb_2.1.7_to_2.1.8.sql into the text area at the right, and click "Execute"

!! Check the configuration files
! SystemGlobals.properties / jforum-custom.conf
Open the file ''WEB-INF/config/SystemGlobals.properties'' and check every property, setting it up according to your needs. Please note that JForum stores customized configurations (those saved from the Admin Panel -> Configurations page) into a file named ''jforum-custom.conf'', which your current installation of JForum may or may not have. If you have it, please make sure to update any necessary value there as well. 

! modulesMapping.properties
Open the file ''WEB-INF/config/modulesMapping.properties'' and remove the following line, if it exists:

''install = net.jforum.view.install.InstallAction''

!! Update ''web.xml''
Starting from version 2.1.8, JForum no longer uses the library DWR for its AJAX calls - now [JQuery|http://jquery.com] is used -, and so it is necessary to ''remove'' all references to the DWR servlet from the file ''web.xml'' (this, of course, if you don't use DWR in other parts of your own system).

Open the file ''WEB-INF/web.xml'', and then search and remove the following declarations:

[{Highlight

<!-- AJAX -->\\
<servlet>\\
	<servlet-name>dwr-invoker\\
	<servlet-class>uk.ltd.getahead.dwr.DWRServlet\\
\\
	<init-param>\\
		<param-name>configJForum\\
		<param-value>WEB-INF/dwr-jforum.xml\\
	</init-param>\\
\\
	<init-param>\\
		<param-name>debug\\
		<param-value>false\\
	</init-param>\\
</servlet>\\
}]

and 

[{Highlight

<servlet-mapping>\\
	<servlet-name>dwr-invoker\\
	<url-pattern>/dwr/*\\
</servlet-mapping>\\
}]

! Delete dwr-jforum.xml
Finally, delete the file ''WEB-INF/dwr-jforum.xml''. That's all. 

!! Testing
Now, test JForum 2.1.8 before adding it to the production environment. The easier way is to put it under some another ''Context''. If it starts  and runs without any problems, then you can proceed to the final step, which is just a matter of replacing the old version with this new one. 

Other jforum examples (source code examples)

Here is a short list of links related to this jforum UpgradingFrom2.1.7To2.1.8.txt source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.