| Your Rating: |
![]() ![]() ![]() ![]()
|
Results: |
![]() ![]() ![]() ![]()
|
0 | rates |
The purpose of this page is showing how a data migration from Magnolia 2.1 to Magnolia 4.0.1 can be done. Each major release, needs a migration in between, due to data structure changes. Each step is described singly.
Ordering of nodes in 2.1
In magnolia 2.1 the nodes were not returned in their order. This was because JCR did not support this at this time. So a value 'sequenceposition' was introduced. On my data migration, the ordering of the nodes was not of any relevance during data migration. Out of this i can not write down a 'how to order the nodes' based on my real experience, but still i try to describe it here in a theoretical way how to do it.
Getting the ordering information
Getting the ordering information (sequenceposition) before the migration to Magnolia 3.0. This information will be lost after migration to Magnolia 3.0 so it has to be extracted before starting with the migration.
The ordering information can be extracted with xpath or sql query.
xpath: //element(*, nt:resource)[PROJECTS:@sequenceposition]}}sql: {{select * from ntbase where sequenceposition is not null
This returns a list of all nodes with the given property.
Output result into a file
The output of the queries above need to be written into a file.
You need to iterate trough the result list and write these values into a file:
- node handle (full path of it)
- the value of 'sequenceposition' nodeData property
The suggestion to do this easiest is using a simple JSP that executes the query and writes the result with the needed data into a file.
Using ordering file in 3.6
Once you manage to get the file with the sequence position information, you can use the ReorderNodes class from migrator to perform re-ordering. It uses this generated file with the ordering information to do the ordering. Again you can run that code from JSP or from a bean shell.
The class you can use for ordering the nodes:
info.magnolia.convertor.ReorderNodes
Which is a part of the magnolia-migrator:
http://svn.magnolia-cms.com/svn/enterprise/magnolia-migrator/trunk/
Migration from 2.1 to 3.0.5
The migration from 2.1 to 3.0.5 is done by subscribing the 2.1 instance to the 3.0.5 instance and activate the websites in 2.1.
On the 3.0.5 instance the migrator add-on has to be used for migrating the data while receiving it from the activation.
Prepare Magnolia 3.0.5 receiver instance
- Using 4.0.1 bundle as 3.0.5
- Download the Magnolia 3.0.5 bundle from http://download.magnolia-cms.com/3.0.5/ and extract it.
- Only the webapp and the migrator add-on will be needed form this bundle. We are not going to use the tomcat of this bundle in cause of the old magnolia_control.sh start up script. It doesn't find on OsX the JRE automatically. We will use for starting the tomcat a new Magnolia bundle like 4.0.1 and replace the webapp itself. Like this we make out of the 4.0.1 actually a 3.0.5 instance.
- Download a new bundle of Magnolia (for example 4.0.1) from http://download.magnolia-cms.com/4.0.1/ and extract it.
- Copy from the Magnolia 3.0.5 bundle the complete webapp content into the webapp folder of the Magnolia 4.0.1 bundle. Delete before it the content of the 4.0.1 webapp folder.
- Copy from the Magnolia 3.0.5 bundle/add-ons the magnolia-migrator-1.0 folder into the add-ons folder of the Magnolia 4.0.1 bundle.
- Delete the "old" 3.0.5 bundle and rename the Magnolia 4.0.1 to 3.0.5 (or just keep in mind, that it is now actually a 3.0.5 bundle.
From now on in this documentation I will refer to this "created" instance as the 3.0.5, referring to this bundle we just "created".
- Copy both jar's from the magnolia-migrator-1.0 add-on into the folder webapps/magnoliaAuthor/WEB-INF/lib in the tomcat server of 3.0.5.
- Delete in the webapp of 3.0.5 the magnoliaPublic instance.
- Copy the templates form the 2.1 instance in /webapps/magnolia/templates to the same folder in 3.0.5
- Changing in the web.xml in magnoliaAuthor the ActivationHandler (using the add-on magnolia-migrator-1.0).
The readme.txt file of the magnolia-migrator-1.0 contains a short description. This is a more detailed description of all steps.
- Overwrite the existing ActivationHandler servlet definition in the web.xml of the receiver webapp 3.0.5 with this servlet definition:
<servlet>
<description>Activation handler servlet</description>
<display-name>magnolia ActivationHandler</display-name>
<servlet-name>ActivationHandler</servlet-name>
<!-- <servlet-class>info.magnolia.cms.exchange.simple.SimpleExchangeServlet</servlet-class> -->
<servlet-class>info.magnolia.convertor.ConvertorServlet</servlet-class>
</servlet>
<servlet>
- Keep original ActivationHandler servlet-mapping entry in web.xml (don't change, not like it could be interpreted from the readme.txt)
<servlet-mapping>
<servlet-name>ActivationHandler</servlet-name>
<url-pattern>/ActivationHandler</url-pattern>
</servlet-mapping>
- Start the 3.0.5 tomcat.
- Set the superuser password to the same value as in the 2.1 instance the superuser has.
- Deactivate all subscribers in 3.0.5.
Now the 3.0.5 receiving webapp is ready for receiving the data from 2.1.
Prepare Magnolia 2.1 sender instance
- Change in the start up script startup.sh in the tomcat bin folder the value -Xmx512m to -Xmx1024m.
This value is for preventing a JavaHeapspace error. It sets the maximum available RAM for the JAVA process. This change is only needed, if a lot of data must be transferred and if there is enough physical RAM available. If a heap space error still occurs, the data should be transferred partially.
- Start the 2.1 instance.
- Deactivate all subscribers in 2.1.
- Create a new subscriber pointing to the 3.0.5 receiver instance. An example of the address value is: localhost:8080/magnoliaAuthor
Transferring and converting the data
- Activate in 2.1 all data that must be transferred. By activating the data, its transferred into the 3.0.5 instance.
- After all data has been activated/transferred:
- Overwrite the existing ActivationHandler servlet-mapping in the web.xml of the receiver webapp 3.0.5 with this servlet-mapping:
<servlet-mapping> <servlet-name>ActivationHandler</servlet-name> <url-pattern>/convertor/migrate/*</url-pattern> </servlet-mapping> - Restart the 3.0.5 instance.
- Add to your 3.0.5 URL the path /convertor/migrate/start.html for example: http://localhost:8081/magnoliaAuthor/convertor/migrate/start.html
- Now all the received data is being converted to 3.0.5 data structure.
Migration from 3.0.5 to 3.5.9
Done as described in:
http://documentation.magnolia-cms.com/releases/3-5-2.html
http://wiki.magnolia-cms.com/display/WIKI/Upgrading+from+3.0+to+3.5
Before updating to 3.5.9 I to delete two nodes due to UUID conflict on import:
- Had to delete in AdminCentral module the intercept filter
- Had to remove in server config the cache filter
Migration from 3.5.9 to 3.6.5
Done as described in:
http://documentation.magnolia-cms.com/releases/3-6.html
That the scripts run as described under this link, copy the 'magnolia-tools-1.0.4' in add-ons into the instance to migrate too. Start the update scripts from this copied 'magnolia-tools-1.0.4'.
Originally in Magnolia 2.1 the 2.1 'jackrabbit-derby-search.xml' persistence manager was used. For changing it to 'jackrabbit-bundle-derby-search.xml' I activated all nodes from the migrated 3.5.9 instance into a new 3.5.9 instance with the correct persistence manager.
Migration from 3.6.5 to 4.0.1
Done as described in:

Comments (2)
Jun 24, 2009
Jan Haderka says:
What about issues with ordering pages and paragraphs after migration from 2.1 to...What about issues with ordering pages and paragraphs after migration from 2.1 to 3.0? Weren't there extra steps you had to perform?
Jul 01, 2009
Christian Ringele says:
Done I'll move now the page to a public part of our wiki.Done
I'll move now the page to a public part of our wiki.