Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Introduction

uPortal now has an export/import system using xml files generated by Cernunnos export scripts.  Basically, you will run an export command on your existing portal project to generate a number of xml data files.  You then run import in your uPortal3 project to import the data from these xml files into your uPortal3 database.  Take a look at the Cernunnos overview to get a better understanding of this process.

Default Database

The default database is populated by the db-import task in build.xml. This task is called by ant initdb, which in turn is called by ant initportal.  The db-import task actually uses crn-import to create the database:

         <antcall target="crn-import">
            <param name="dir" value="${basedir}/uportal-impl/src/main/resources/properties/db/entities" />
        </antcall>

As you can see, it simply calls crn-import on the entities directory.  Take a look at this directory to see the xml format for groups, layouts, channels, etc.

Exporting

The export procedure for uPortal versions <3.0 is different than those >=3.0.  Read the appropriate section for the portal you are exporting from.

 uPortal >= 3.0

 To export simply run:

 ant crn-export -Dtype=<type> -Ddir=<export_directory>

This will generate a number of xml files in the specified directory. The available types are printed if you call crn-export without a type, or can be examined in the export_internal.crn file.  Some types take a sysid parameter, for example, to export a single layout, run:

 ant crn-export -Dtype=layout -Ddir=<export_directory> -Dsysid=<username>

uPortal < 3.0

Exporting from an earlier version of uPortal is a bit of an adventure.  Some of the branches have had the export system backported.  However, Eric Dalquist made a major commit to uPortal/trunk with r44591 on 1/13/2009.  Any improvements with this commit probably have yet to be backported.  For example, 2.5-patches had the export system committed with r42716 on 12/12/2007 and is way out of date.  The backports have an import-export.xml file that you call ant on.  For example:

 ant -f import-export.xml export -Ddir=<export_dir> -Dtype=all

You could use this file, or else just add a crn-export task to your build.xml file.

When CalPoly performed it's migration the cernunnos scripts were under heavy development, I first applied the 2.5-patches branch export commit to our portal, then merged in some of the newer scripts from uPortal/trunk.  Presently, it may be cleaner to simply work off uPortal/trunk.

 Recommended Procedure

Here is what I would recommend doing:

  1. Branch your portal project in your repository.  You may have an undeployable portal after all of this due to upgraded jars and changes to build.properties.  Better to keep this work cleanly separated.
  2. Copy the files from https://www.ja-sig.org/svn/uPortal/trunk_ under _uportal-impl/src/main/resources/org/jasig/portal/io into your portal project.
  3. Hook into the scripts by copying import-export.xml from a backported branch or by just adding a crn-export task to your build.xml similar to the uPortal/trunk build.xml file.
  4. Get the latest cernunnons jar from uPortal/trunk and put it in your classpath
  5. You may need to upgrade other jar files, I copied used all of the new jars from Eric's export.zip patch found in this JIRA issue. I had to upgrade to Spring as well. In the end, instead of setting every jar in build.properties, I just added lib/*.jar to the ant classpath.
  6. Develop an export procedure as you troubleshoot the problems you encounter.  See the notes on the CalPoly export procedure.
  • No labels