close

Filter

loading table of contents...

Content Server Manual / Version 2201

Table Of Contents

3.13.2.17 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 (source) do not have to match those on the import server (target). 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 5.5.3.3, “ServerImport and ServerExport in Blueprint Developer Manual .

UUIDs – Universally Unique Identifiers

serverexport and serverimport provide an option to transfer UUIDs from the export server (source) to the import server (target).

Limitations:

  • Documents Only: Because serverexport and serverimport create folders only implicitly, that is, there is no artifact in serverexport explicitly referring to a folder, UUIDs for folders are not going to be transferred between two systems.

  • New Content Only: Only newly created documents will get the UUID set. This is because you may have used the UUID of the target system already as reference.

  • Content UUIDs Only: As serverexport and serverimport do not deal with versions, UUIDs of versions are not synchronized between source and target system.

  • Paths First – Issues with Duplicate UUIDs: As serverexport and serverimport use the path information to identify identical contents, conflicts for UUIDs may be reported if you moved/renamed contents in source and target system. To resolve issues like this, you may want to use --skip-uuids option for serverimport.

Upgrade Scenarios:

If you upgraded from versions prior to 2010.1, or if you forgot to include UUIDs for such a transfer scenario once, you may want to read Section 3.13.2.4, “Content-UUID-Migration.

For details on UUID support in CoreMedia Content Cloud see Section 5.2, “UUIDs” in Unified API 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
-z, --zip <URL> Import the contents of the zip file. This is equivalent to manually extracting the zip and importing the extraction directory.
-zd, --zip-directory <directory/within/zipfile> As a refinement of the -z option, you can restrict the import to a particular directory within the zip file.
-h, --halt Halt on error. Using this option is recommended to prevent any inconsistent state of the imported content, like for example links to embedded images in Richtext removed, because they are missing on server and in server export files.
-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.
--skip-uuids

If the export files contain UUIDs (see option --include-uuids for serverexport), you may skip importing them. This will generate a random UUID for each newly created content.

This option may also be used to resolve problems on import of contents with UUID. You may struggle for example with duplicate UUIDs, if you moved your contents in source or target system. This option will ignore the problem and create a random UUID instead.

To resolve partial duplicate UUIDs while creating contents with UUIDs where possible, first run without this option and repeat the very same import afterwards with this option enabled.

For details see Section “UUIDs – Universally Unique Identifiers”.

-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.37. Parameters of the serverimport utility


On executing the program, a zip URL or 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> | -z <URL> ] [other options] [ <id> | <uuid> | <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.
-z, --zip <URL> Create a zip file of the exported contents. The URL must be writable. Currently, file URLs and s3 URLs (AWS) are known to work. s3 URLs assume that your environment provides suitable credentials. For details see Working with AWS Credentials.
-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.
-U, --include-uuids

By default, UUIDs of contents are not exported. As a result, contents created on import will get random UUIDs. If you add this option, UUIDs will be added to the export files.

UUIDs in export files will be automatically taken into account by serverimport, unless you use the option --skip-uuids.

For details see Section “UUIDs – Universally Unique Identifiers”.

-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.38. Parameters of the serverexport utility


As optional arguments, the IDs, UUIDs 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).

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.