[opencms-dev] OpenCms 6.0 beta 2 released / Upgrading from beta 1

Alexander Kandzior alex at opencms.org
Fri Apr 1 05:15:36 CEST 2005


> What is the recommended way to upgrade from 6.0b1 to beta2 ?
..
> However we've entered some data into beta1 by now, which 
> would like to preserve. So what is the best way to upgrade 
> well keeping the content? 

The best safest and easiest way to upgrade is to export the site contents
(e.g. everyting in /sites/default/) plus all modules that have been created.
Then set up a frash installation with beta 2 and import everything again. 

If done correctly, this certainly works. Please make sure that you import
from the same site setting you exported from. So if you exported from
"/sites/default/" make sure you are _not_ in the root sie "/" when
importing. 

You can also keep you existing database without import / export, but this
should be done only if absolutly required. More (optional) details on the
upgrade process follow.


Modules / Individual resource type:

The syntax for defining the resource type id / name in the configuration
files (opencms-vfs.xml / opencms-modules.xml) has slightly changed. This
will only affect you if you have created your own module that includes a new
resource type. The id / name are attributes of the <type> node now, instead
of param subnodes. Best check the opencms-vfs.xml that comes with the b2
distribution, should be pretty straightforward to adjust. See below for
examples / details.


Site configuration in opencms-system.xml:

The site configuration also has changed. It's now possible to define <alias>
sites names for one site. This will only affect you if you have altered the
site configuration. The Alkacon documentation module that comes with the b2
distribution explains the new options. 


Upgrading without export / import (keeping the database):

The database schema has not changed since b1, so it's possible to upgrade to
b2 by "just" replacing the .jar files _and_ changing the configuration
files. As said above the configuration has changed in a couple of files
(system/vfs/search/workplace...). To upgrade, best use some sort of "diff"
to check for differences between the b1 and b2 files and update / replace
what's required. 

One important change is the "re-shuffeling" of resource type id's. The
numeric id's of resource types have changed, and this will mean to continue
to use you db without export / import you must use the old id values in
opencms-vfs.xml and opencms-moduls.xml. Here's the configuration for
opencms-vfs.xml with the _old_ ids:

<resourcetypes>
	<type class="org.opencms.file.types.CmsResourceTypeFolder"
name="folder" id="0"/>
	<type class="org.opencms.file.types.CmsResourceTypePlain"
name="plain" id="3">
		<mapping suffix=".txt" />
		<mapping suffix=".html" />
		<mapping suffix=".htm" />
	</type>
	<type class="org.opencms.file.types.CmsResourceTypeBinary"
name="binary" id="5">
		<mapping suffix=".pdf" />
		<mapping suffix=".zip" />
		<mapping suffix=".class" />
		<mapping suffix=".ppt" />
		<mapping suffix=".doc" />
		<mapping suffix=".xls" />
	</type>
	<type class="org.opencms.file.types.CmsResourceTypeImage"
name="image" id="6">
		<mapping suffix=".jpeg" />
		<mapping suffix=".jpg" />
		<mapping suffix=".gif" />
		<mapping suffix=".png" />
		<mapping suffix=".tif" />
		<mapping suffix=".tiff" />
	</type>
	<type class="org.opencms.file.types.CmsResourceTypeJsp" name="jsp"
id="8">
		<mapping suffix=".jsp" />
	</type>
	<type class="org.opencms.file.types.CmsResourceTypePointer"
name="pointer" id="99"/>
	<type class="org.opencms.file.types.CmsResourceTypeXmlPage"
name="xmlpage" id="10"/>
	<type class="org.opencms.file.types.CmsResourceTypeXmlContent"
name="xmlcontent" id="11"/>
	<type class="org.opencms.file.types.CmsResourceTypeFolderExtended"
name="imagegallery" id="15">
		<param
name="folder.class">org.opencms.workplace.galleries.CmsImageGallery</param>
	</type>
	<type class="org.opencms.file.types.CmsResourceTypeFolderExtended"
name="downloadgallery" id="18">
		<param
name="folder.class">org.opencms.workplace.galleries.CmsDownloadGallery</para
m>
	</type>	
	<type class="org.opencms.file.types.CmsResourceTypeFolderExtended"
name="linkgallery" id="16">
		<param
name="folder.class">org.opencms.workplace.galleries.CmsLinkGallery</param>
	</type>
	<type class="org.opencms.file.types.CmsResourceTypeFolderExtended"
name="htmlgallery" id="17">
		<param
name="folder.class">org.opencms.workplace.galleries.CmsHtmlGallery</param>
	</type>						
	<type class="com.opencms.legacy.CmsResourceTypeXMLTemplate"
name="XMLTemplate" id="4"/>					
</resourcetypes>

The same adjustment needs to be done in modules manifext.xml which add new
resource types.

Example NEW b2:

<resourcetypes>
	<type class="org.opencms.file.types.CmsResourceTypeXmlContent"
name="article" id="12">
		<param
name="schema">/sites/default/xmlcontent/article.xsd</param>
	</type>	
</resourcetypes>

Example OLD a2-b1:

<resourcetypes>
	<type class="org.opencms.file.types.CmsResourceTypeXmlContent">
		<param name="resource.type.id">12</param>
		<param name="resource.type.name">article</param>
		<param
name="schema">/sites/default/xmlcontent/article.xsd</param>	
	</type>	
</resourcetypes>

Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com






More information about the opencms-dev mailing list