loading table of contents...

3.14.2.13. Serverimport/Serverexport

CoreMedia content items can be exported into XML files in the file system with the cm serverexport utility. These files can be imported again with cm serverimport. The cm serverimport is different from the CoreMedia XML Importer, which is described in the [Importer Manual].

The following limitations for export exist:

  • Only the latest version of a content item is exported.

  • No metadata, such as the last modification date or the status 'published', is exported.

  • For content items marked for deletion, only name and path are exported.

  • Empty folders are not exported, because they contain no content items.

From the limitations mentioned above the following consequences arise for import:

  • Only the latest version of a content item can be imported.

  • content items which were marked for deletion are empty, that is all property fields contain null values, such as empty strings, zeros, etc.

  • Every imported content item has the status "checked in" and "not approved".

  • Content items with invalid XML property values will not be imported. You can force an import of such content items with the option --no-validate-xml (not recommended).

  • Content items with link list property values that violate the minimum or maximum cardinality for the property type will not be imported. You can force an import of such content items with the option --no-validate-link-cardinality (not recommended).

XML files are created so that internal links to these content items are maintained after import. On import of the complete content of a CoreMedia Server, the content, the folder structure of the content items and the linking of the content items is maintained for content items not marked for deletion.

The properties of the content types on the export server do not have to match those on the import server. Those which are not available on the import server are ignored, and those which exist in addition are filled with null values.

If a content item already exists on the import server, then a new version of the content item will be created.

Multi-Site

Localizable content items have two special properties master and masterVersion, both defined in the SiteModel. Because versions are lost on export / import, serverimport and serverexport have a special handling built in for these two properties in order to set a reasonable masterVersion during an import. For details consult Section 6.5.3.3, “ServerImport and ServerExport in CoreMedia Digital Experience Platform 8 Developer Manual.

Server Import

The Importer command has the following syntax:

cm serverimport -u <user> [other options] ( <file> | <dir> )...

The options have the following meaning:

Parameter Description
-r, --recursive Recursive import of files and subdirectories on entry of a directory to be imported
-h, --halt Halt on error
-v, --verbose enables verbose output
--no-validate-xml Disables XML property value validation. By default, content items with invalid XML property values will not be imported. This option can be used to force an import of such documents (not recommended).
--no-validate-link-cardinality Disables validation of link list cardinalities. By default, documents with link list property values that violate the minimum or maximum cardinality for the property type will not be imported. This option can be used to force an import of such documents (not recommended).
--skip-entities Skips resolution of external XML entities in imported files. By default, XML entities are resolved which may trigger requests to external servers.
-t, --threads <threads> Use the given number of threads for importing content. Multiple threads may increase throughput in the presence of network and database latency, and may increase CPU utilization. Default: 1
-u, --user <user name> Name of the user.
-d, --domain <domain> The domain of the user.
-p, --password <password> Password of the user. The tool will prompt the user for a password if not specified as option.
-url <ior url> The IOR URL of the Content Server.

Table 3.30. Parameters of the serverimport utility


On executing the program, the path of at least one XML file or directory must be given as argument. Relative paths are allowed and refer to the current directory in which the program was started.

Server Export

The exporter command has the following syntax:

cm serverexport -u <user> -b <basedir> [other options] [ <id> | <path> ]...

The options have the following meaning:

Parameter Description
-r, --recursive Recursive export of files and subdirectories on entry of a directory for export.
-b, --basedir <basedir> The directory in which the exported XML files are saved. A relative path is relative to the working directory.
-v, --verbose enables verbose output
-enc The encoding of the server export. "ISO-8859-1" creates a server export in Iso-Latin-1. The default value is "UTF-8" which creates an export in Unicode. Used values for coding must be supported by Java.
-cut <length> The serverexport utility exports the files in a directory structure which reflects the folder structure of the CoreMedia repository. The resulting path length may exceed OS limits, so you can use the -cut option to limit the maximum path length. By default, no limit will be applied. The shortened path will not affect the reimport of the exported files.
-pretty Specifies if the exported XML files should be pretty printed.
-l, --lint <warning>

Enables different warnings to be logged. The following warnings can be specified:

linkignored (default)

Warn on links to either destroyed or deleted contents which are ignored on export.

linkmissing

Warn on links whose target is not part of the export. This might lead to inconsistencies on import: link target might not be available or link target's content might be outdated.

translationstate

Warn on translation states (see Multi-Site) which are considered harmful especially because they cannot be rebuilt exactly on import.

all

Warn on all detected issues.

none

Disable warnings.

-fow, --fail-on-warning Fail if any of the warnings configured by lint occurs
-fae, --fail-at-end Only fail at end providing a summary of all issues found.
-u, --user <user name> Name of the user.
-d, --domain <domain> The domain of the user.
-p, --password <password> Password of the user. The tool will prompt the user for a password if not specified as option.
-url <ior url> The IOR URL of the Content Server.
--blobsizelimit <size> Used in conjunction with -s. Default: 1MB. Blobs larger than the given number of bytes are stored in the directory defined by sharedblobbasedir.
-s, --sharedblobbasedir <sharedblobbasedir> The directory in which to store blobs that are larger than the size given by blobsizelimit. Equal blobs will be stored only once.

Table 3.31. Parameters of the serverexport utility


As optional arguments, the IDs or the folder paths of CoreMedia resources can be entered.

Example:

cm serverexport -r -u admin -p admin -b /export 7531

This call of serverexport will export all content items and subfolders (-r) of the folder with the ID 7531 into the /export directory. The program logs in at the server as the admin user, using the admin password (which should never be admin as in the example).