Supported Operations
Import/Export provides IMPORT, LIST, EXPORT, and DELETE operations for supported portal entities.
Import
Adds the entities defined in the specified XML file(s) to the portal database. If the specified entities are already present – determined by Id
, Name
, or other primary key, as appropriate – this operation will update the existing entity to match the information provided in the XML.
Usage
ant data-import -Ddir={path-to-directory} [-Dpattern={ant-pattern}]
Where path-to-directory
is a file system directory, absolute or relative, containing uPortal Import/Export XML files; and pattern
is an (optional) Ant Filesystem Pattern specifying a file name pattern that candidate files must match.
ant data-import -Dfile={path-to-file}
Where path-to-file
is a file system path, absolute or relative, containing uPortal Import/Export XML file.
List
Lists the data types the portal knows how to import/export/delete and can list all of the data currently in the database for a specific type. The data-list
command with no arguments lists all supported portal data types and the operations (export, delete) supported for each. By adding the -Dtype=
parameter all data that currently exists in the portal for that data type is listed
Usage
ant data-list
Example output:
[java] INFO Export and Delete Support by Data Type [java] INFO Data Type | Export | Delete [java] INFO -----------------------+--------+-------- [java] INFO entity-type | true | false [java] INFO fragment-definition | true | false [java] INFO fragment-layout | true | false [java] INFO group-membership | true | false [java] INFO layout | true | false [java] INFO permission-owner | true | true [java] INFO permission-set | true | false [java] INFO portlet-definition | true | true [java] INFO portlet-type | true | true [java] INFO profile | true | false [java] INFO stylesheet-descriptor | true | true [java] INFO user | true | true
ant data-list -Dtype={entity-type}
Where entity-type
is the name of a portal data type, these can be determined by the plain ant data-list
command.
Example Output, note that the part before the " - " is the sysid
to use with the data-export and data-delete commands.
[java] INFO All portlet-definition data [java] INFO fragment-audit - Audit DLM Fragments [java] INFO forgot-password - Forgot Password [java] INFO passwordmgr - Password Management [java] INFO ImportExportPortlet - Import Export Portlet [java] INFO cache-manager - Cache Manager [java] INFO popular-portlets - Most Popular Apps
Export
Creates XML files representing the requested entities and writes them to the specified file system location.
Usage
ant data-export -Ddir={path-to-directory} -Dtype={entity-type} [-Dsysid={entity-identifier}]
Where path-to-directory
is a file system directory, absolute or relative, wherein XML will be written; and entity-type
is any supported entity type (see table below); and entity-identifier
is the Id
or Name
of a single entity of the specified type. The -Dsysid
argument is not required for entity types that begin with "all-."
Named Sub-directories
On export, XML documents will be organized into sub-directories by entity type: e.g. channel
, layout
, user
, etc.
Delete
Removes the specified entities as well as dependent (orphaned) entities from the portal database.
Warning
The DELETE feature should be used with extreme caution and is more appropriate for DEV and TEST portals than for PROD. It is possible to make your portal unusable by deleting the wrong thing.
Usage
ant data-delete -Dtype={entity-type} [-Dsysid={entity-identifier}]
Where entity-type
is any supported entity type and entity-identifier
is the Id
or Name
of a single entity of the specified type.