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>