Chapter 2. Migration Tools

Preamble
Install the migration libraries
How to use this tool
Component Configuration retrieving
Migration Managed components
Export all Components
Migration Managed Components
eXo Portal Components migration
ECM Configuration and Templates Confiuration
Data Migration

PLF 3.0 provides a set of tools to migrate user and system data from your AIO instance to your new PLF 3.0 instance

Who should read this document ?

You should need this guide if you are in the process of upgrading your system from AIO 1.6 to PLF 3.0 and have data to migrate.

The main migration tool provided is called the Configuration Marshaller. This tool is capable of inspecting the source (AIO) kernel components and performing a set of migration tasks, typically exporting in a format that can be easily reinjected in the Platform 3.0 instance.

The Marshaller is a pluggable service that exposes a REST interface. So most of the interaction with this tool will consist of hitting specific URLs to execute specific migration tasks.

The migration tool provide several services that you may need for your migration :

Some libraries need to be installed. Two for your source AIO server and two others to deploy on your target Platform server.

Step 1: Deploy the source migration library on your AIO instance

After the server startup is complete, you could access to this service by typing this URL <SERVERNAME>:<SERVERPORT>/portal/rest/containersConfiguration/.

Step 2 : Deploy the target migration library on your PLF instance

After the server startup is complete, you could access to this service by typing this URL: <SERVERNAME>:<SERVERPORT>/rest/containersConfiguration/.

The Marshaller provides a feature that allows to retrieve kernel configurations of components loaded in the eXo containers. It is capable of retrieving all components and their configured external-component-plugins.

This is very handy to capture customizations before reintroducing in your PLF extension project.

Once the migration library is deployed in your AIO instance, hit : <SERVER_NAME>:<SERVER_PORT>/rest/containersConfiguration/, this will list all containers on this server :

The first link will list all services of the root container, and the second will list all components of the portal container.

Clicking on the second one will result in something like that :

Clicking on each component will return the kernel configuration for this component. For example, click on org.exoplatform.services.naming.InitialContextInitializer, you should get something like this:


<configuration>
  <component>
    <key>org.exoplatform.services.naming.InitialContextInitializer</key>
    <type>org.exoplatform.services.naming.InitialContextInitializer</type>
    <component-plugins>
...
    </component-plugins>
    <init-params>
...
    </init-params>
  </component>
</configuration>

Any configuration can be retrieved in this way.

This migration tool will allow you to change the adopted OrganizationService implementation. For example, this will be very helpful if you attempt to use the PicketLink IDM implementation instead of Hibernate, LDAP or Active Directory implementation.

This tool consists of exporting data from the source (AIO) server and reimporting in the target (PLF) server.

The approach here is to dump the source model data (membership types, groups, and users) as a set of XML configurations for the OrganizationDatabaseInitializer. It makes the export agnostic to the actual datasource (LDAP or DB).

The dump is performed by an interceptor plugin of the Marshaller that :

Configuration The org service interceptor generates three main entries that will be easily injected in the target server :

To successfully export your current organization model data, please follow these steps :

The organizational model data is now exported in a zip file that contains an organization model data as a set on XML files.

The content of the zip file looks like:

The zip can now be used to import the organization data in.

The first step is to wire the exported OrganizationDataInitializer configurations in the external configuration directory.

e.g: replace the hibernate implementation by the PicketLinkIDM one:

by the PicketLinkIDM implementation

AIO PLF

[...]
<type>org.exoplatform.services.cms.drives.impl.NewGroupListener</type>
[...]
<value-param>
 <name>allowCreateFolder</name>
 <value>Both</value>
</value-param>
[...]

[...]
<type>org.exoplatform.services.cms.drives.impl.NewGroupListener</type>
[...]
<value-param>
  <name>allowCreateFolder</name>
  <value>nt:folder,nt:unstructured</value>
</value-param>
<value-param>
  <name>allowNodeTypesOnTree</name>
  <value>*</value>
</value-param>
[...]

  • Start your server

Tip

profiles/ and users/ folders are not needed at this stage, you can remove these folders before you start the server.

On startup, the portal container will load the organization model data from <TOMCATHOME>/gatein/conf/portal/<YOURPORTALCONTAINERNAME>/configuration.xml :

[...]
  <import>OrganizationDataModel/Groups-MembershipTypes.xml</import>
  <import>OrganizationDataModel/Users0.xml</import>
  <import>OrganizationDataModel/Users1.xml</import>
[...]

Tip

You can verify that these configurations are properly loaded by starting with gatein-dev.sh run and inspecting the console. Here is an example of the server's console output:

[...]
INFO: Add configuration file:/exo-working/tomcat/gatein/conf/portal/<YOUR_PORTAL_CONTAINER_NAME>/configuration.xml
Dec 14, 2010 3:52:25 PM org.exoplatform.container.configuration.ConfigurationManagerImpl addConfiguration
INFO: 	import file:/exo-working/tomcat/gatein/conf/portal/<YOUR_PORTAL_CONTAINER_NAME>/OrganizationDataModel/Groups-MembershipTypes.xml
Dec 14, 2010 3:52:25 PM org.exoplatform.container.configuration.ConfigurationManagerImpl addConfiguration
INFO: 	import file:/exo-working/tomcat/gatein/conf/portal/<YOUR_PORTAL_CONTAINER_NAME>/OrganizationDataModel/Users0.xml
Dec 14, 2010 3:52:25 PM org.exoplatform.container.configuration.ConfigurationManagerImpl addConfiguration
INFO: 	import file:/exo-working/tomcat/gatein/conf/portal/<YOUR_PORTAL_CONTAINER_NAME>/OrganizationDataModel/Users1.xml
Dec 14, 2010 3:52:25 PM org.exoplatform.container.configuration.ConfigurationManagerImpl addConfiguration
[...]

The User Portal Configuration is made of navigation, pages, portlet preferences and Gadgets.

The Resource Bundles are the files that contain translation for the user interface of the portal. In AIO, an UI was provided to edit the Resource Bundles. This UI has not been maintained as the Resource Bundles are no longer persistent in PLF. Since, the UI has significantly evolved between AIO and PLF, there are little chances that you can reuse the translated Resource Bundles in PLF. However, we provide a service that lets you retrieve your AIO Resource Bundles.

The main goal of this RESTfull Service is to migrate the totality of an AIO Collaboration workspace, to PLF compliant collaboration&knowledge workspaces. So it is only useful in case of you have already a collaboration workspace in an AIO server, that is in production or pre-production environment. Otherwise, if your AIO project is in a development phase, you will probably not need to use this tool.

Steps:

After that, you will get two sub-folders in the chosen location:

  • Version History nodes.

  • Bonita business processes definitions nodes

  1. Knowledge backup : the content of PLF knowledge workspace. This data is generated from AIO Collaboration workspace, it contains the FAQ&Forum data nodes (Categories, posts ...).

  2. In PLF, use this documentation steps to perform a restore for each workspace, download this configuration to put in "TOMCAT/gatein/conf/portal/portal/" as an example.

In PLF, the default publication plugin has changed to a new one that is more flexible, it's called 'Authoring plugin'. The old one, StageAndVersion, is now deprecated. It is recommended that you upgrade to the new plugin. Read more about the new Authoring plugin in ECMS reference guide.

Although, it is possible to configure much more sophisticated lifecycles, you can migrate transparently for your users by configuring a lifecycle that reproduces the states of the StageAndVersion plugin:

	<external-component-plugins>
		<target-component>org.exoplatform.services.wcm.extensions.publication.PublicationManager</target-component>
		<component-plugin>
			<name>AddLifecycle</name>
			<set-method>addLifecycle</set-method>
			<type>org.exoplatform.services.wcm.extensions.publication.lifecycle.StatesLifecyclePlugin</type>
			<description>Configures</description>
			<priority>1</priority>
			<init-params>
				<object-param>
					<name>lifecycles</name>
					<object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig">
						<field name="lifecycles">
							<collection type="java.util.ArrayList">
								<value>
									<object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig$Lifecycle">
										<field name="name"><string>lifecycle2</string></field>
										<field name="publicationPlugin"><string>Authoring publication</string></field>
										<field name="states">
											<collection type="java.util.ArrayList">
												<value>
													<object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig$State">
														<field name="state"><string>draft</string></field>
														<field name="membership"><string>*:/platform/users</string></field>
													</object>
												</value>
												<value>
													<object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig$State">
														<field name="state"><string>published</string></field>
														<field name="membership"><string>*:/platform/users</string></field>
													</object>
												</value>
											</collection>
										</field>
									</object>
								</value>
							</collection>
						</field>
					</object>
				</object-param>
			</init-params>
		</component-plugin>
	</external-component-plugins>

Use Crash to connect to the JCR command line (See latest crash documentation link here)

  1. Execute those crash commands for root/gtn as user/password:

telnet localhost 5000
connect {{{-}}}c  portal {{{-}}}u root {{{-}}}p gtn collaboration
select * from publication:stateAndVersionBasedPublication where publication:lifecycleName<>'Authoring publication' {{{-}}}a {{{|}}} addmixin publication:authoring
select * from publication:stateAndVersionBasedPublication where publication:lifecycleName<>'Authoring publication' {{{-}}}a {{{|}}} addmixin publication:authoringPublication
select * from publication:stateAndVersionBasedPublication where publication:lifecycleName<>'Authoring publication' {{{-}}}a {{{|}}} set publication:lastUser "__system"
select * from publication:stateAndVersionBasedPublication where publication:lifecycleName<>'Authoring publication' {{{-}}}a {{{|}}} set publication:lifecycle "lifecycle2"
select * from publication:stateAndVersionBasedPublication where publication:lifecycleName<>'Authoring publication' {{{-}}}a {{{|}}} set publication:lifecycleName "Authoring publication"
commit
disconnect

Warning

The versionHistory nodes will remain working with StageAndVersion Publication plugin, because the versionHistory nodes couldn't be modified by users, it's system protected nodes.