loading table of contents...

3.14.1.1. Dump

The dump utility prints out arbitrary objects of the CoreMedia CMS repository. You will probably use it mainly to dump resources, but you can also dump users, processes etc.

usage: cm dump -u <user> [other options] [<id1> <id2> ... |
 -t <path1> <path2> ... |
 -pn <name1> <name2> ... |
 -cn <name1> <name2> ... |
 -un <name1> <name2> ... |
 -gn <name1> <name2> ...]
 If not properly prefixed, IDs are interpreted as numeric
 content IDs, content repository paths, user names, group
 names or content type names as appropriate.


 Available options:

 -f,--file-name <file name>    dump the output to the
                               given file (using UTF-8)
 -d,--domain                   domain for login
                               (default=<builtin>)
 -e,--encoding                 output encoding for dump
                               (default=platform encoding)
 -cn,--contenttype-name        names of contenttypes to dump
 -gn,--group <group>           names of groups to dump
 -p,--password                 password for login
 -pn,--processdefinition-name  names of processdefinitions 
                               to dump
 -t,--paths                    path of contents to dump
 -u,--user                     user for login (required)
 -un,--user-name <user>        names of users to dump
 -url <ior url>                url to connect to
 -v,--verbose                  enables verbose output

The options have the following meaning:

Parameter Description
-f <file name> Name of the file where to dump the output using UTF-8 encoding. By default, the output is written to stdout.
-e <encoding> Choose the encoding of the dump output. "ISO-8859-1" creates a dump in ISO-Latin-1. "UTF-8" creates a Unicode dump. The default value is the platform encoding. Consult the API documentation of java.nio.charset.Charset of your particular JRE to find out other supported values.
-un <names> The named users to dump.
-gn <names> The named groups to dump
-pn <names> The named process definitions ("workflows") to dump
-cn <names> The named content types to dump
-t <paths> The paths of resources to dump.

Table 3.12. Options of dump


The standard way to specify a resource to be dumped is its ID. To dump the root folder, for example, you call

> cm dump -u admin -p admin 1

and get a result like

content: coremedia:///cap/content/1
  type: Folder (coremedia:///cap/contenttype/Folder_)
  path: /
  created by: admin (coremedia:///cap/user/0), creation date:
    2004-12-20T07:57:19+00:00
  modified by: admin (coremedia:///cap/user/0), 
    modification date: 2004-12-20T07:59:48+00:00
  is place approved: true, place approved by: -, 
    place approval date: 2004-12-20T07:57:19+00:00
  is published: true, published by: -, publication date: 
    2004-12-20T07:57:19+00:00
  to be deleted: false, to be withdrawn: false
  is checked out: false, current editor: -
  children: 
    /Home (coremedia:///cap/content/5)
    /Inbox (coremedia:///cap/content/3)
    /System (coremedia:///cap/content/9)
    /work (coremedia:///cap/content/13)
    /work2 (coremedia:///cap/content/15)

The result for a content item looks similar; instead of the children you get detailed information about all versions of the content item. If you don't know the IDs of the resources you want to dump, you can alternatively specify their paths with the -t option, for example,

> cm dump -u admin -p admin -t /work/article1 /work/image1

You can dump users and groups by specifying their names with the -n option, for example,

> cm dump -u admin -p admin -un publisher -gn system

dumps the user publisher and the group system.

However, all these examples are only special convenient variants of invoking the dump tool. As you can see in the very first line of the result of dumping the root folder, the actual ID of the root folder is not 1, but coremedia:///cap/content/1, and this format is the general way to use dump:

> cm dump -u admin -p admin coremedia:///cap/content/1

Each CoreMedia CMS object has such an ID and can be dumped. Try the above example for dumping users and groups, and you will get IDs like coremedia:///cap/user/5 and coremedia:///cap/group/1. You will obtain IDs of other objects by the other server tools:

  • The tool cm processdefinitions gives you IDs of workflow process definitions.

  • The tool cm processes gives you IDs of running processes.

  • Section 3.14.1.10, “Sessions” shows how to get IDs of open sessions.

The dump tool tries some additional heuristics to interpret strings given on the command line that do not match an ID pattern. IDs containing a slash are treated as a content repository path. String may also be interpreted as user names, group names or content type names if possible.