Syntax: dsexport [options] handles-or-classnames
Note: Not supported for use with DocuShare Archive Server.
The dsexport command exports, by default, site objects into an XML formatted file. Use an -f option to force export into a CSV formatted file. The resulting file can then be used as input to dsimport on another DocuShare server or as input to some other destination. The objects whose information is output are not removed from the DocuShare repository.
Unlike most other DocuShare commands, dsexport allows you to specify a specific object or an entire class of objects. Dsexport can export specific Spaces, but not the entire Space classname. The objecthandles-or-classnames is either the handle of the object in the DocuShare repository that is to be exported, or is the name of a DocuShare object class (for example, Collection, Document, or User). When a class name is used, every repository object of that class is output. More than one handle or class name, each separated by a space, can be provided.
Note: System objects, such as User-1, User-2, and Group-1, renditions, subscriptions, and versions cannot be exported. Renditions and versions are not exported on their own, but exported as part of document objects.
Options for dsexport
-c Supports regular expression matching; does not support wildcard characters in the condition file. When specifying a date property in the conditional file, use the format mm/dd/yyyy, as in 03/09/2009, not 3/9/09.
Note: The -c option does not work for User and Group classes. The Users and Groups MUST be exported even if they don't satisfy the conditions.
-d Destination. Specifies a directory in which to put the output of dsexport. The default destination is the current working directory. Dsexport creates in the destination directory, a directory with the same name as the handle being extracted. Within that directory, it creates an XML file called handle.xml and a directory called documents. All extracted documents (the original end-user documents associated with a document object) end up in the documents directory.
-e Encoding. Specifies character code of output file. By default UTF-8 is used.
-f Force. Force export in CSV format.
-g Groups. When a group is exported, it recursively exports the groups and users of its children. Without -g, only groups explicitly referenced in exported objects’ ACLs are exported.
-h Help. Display command help text.
-l Level. Write the specified level (debug, trace, info, warn, error, fatal) message to the log file.
-m Metadata only. When exporting document objects, only their metadata (properties) are exported. The documents themselves are not exported.
-p Property. Include the given property in the exported data. If no property is specified, all properties for each object will be exported. If one or more property options are specified, only those properties will be exported. Only one -p needs to be used in a single command line. Multiple properties should be comma separated without white space characters unlike Docushare 2.2. An object's handle is always exported.
-q Quiet. Run the command in quiet mode. Suppresses all informational messages and user yes/no prompts. Assume Yes to all prompts and proceed at your own risk.
-r Recursive. Recursively output objects by following all references leading from handle, including users listed in permission settings and objects contained within handle. It only traverses down containment hierarchies, not up through parent links. Without the –r option, dsexport outputs only the object specified by handle. The –r option has no effect if handle-or-classname is a class name.
-s Subscription. Enable the export of Subscriptions.
-t Thread. Maximum thread number. By default multi-thread exporting is disabled. If set to an integer between 2 and 20, the multi-thread exporting feature is enabled.
Note: The maximum thread number is 20; larger numbers default back to 20.
-u User. Run the command as the specified user. Requires a user handle as an argument. By default, all commands run as the admin user, which gives them unrestricted rights and makes admin the author of any edit operations performed by the command. For example, specifying -u User-12 causes the command to run as User-12 instead of admin
Examples using dsexport
dsexport -r -d \export Collection-141 — exports Collection-141 and all its contents to XML.
The following files are exported:
D:\export\Collection-141\Collection-141.xml
D:\export\Collection-141\documents
D:\export\Collection-141\documents\Rendition-11_2.29 other r.02.doc
D:\export\Collection-141\documents\Rendition-12_2.19.doc
D:\export\Collection-141\documents\Rendition-13_2.20.doc
D:\export\Collection-141\documents\Rendition-14_2.22.doc
D:\export\Collection-141\documents\Rendition-15_2.23.doc
D:\export\Collection-141\documents\Rendition-16_2.26 R02.doc
D:\export\Collection-141\documents\Rendition-17_2.26.doc
D:\export\Collection-141\documents\Rendition-18_2.29 imari r0.2.doc
D:\export\Collection-141\documents\Rendition-19_2.29 imari.doc
D:\export\Collection-141\documents\Rendition-20_2.19 R02.doc
To export specific files in a collection:
Suppose a Collection-X named, Strong test, contains a URL named e-HongKong site, a Collection-Y
named khong guan biscuit and a Document named test.
Example 1:
a. Create a file named cond.txt, that contains title = .*ong.*
b. In a command line, run dsexport - r -c cond.txt -r Collection-X.
This only exports the object whose title contains ong. So only the Strong test collection, e-
HongKong site URL and khong guan biscuit are exported.
The test document is not exported.
Example 2:
a. Create a file named cond2.txt, that contains title = .*[h|H]ong.*
b. In a command line, run dsexport –r -c cond.txt Collection-X.
This only exports the object whose title contains hong or Hong. So only the e-HongKong site
URL and khong guan biscuit are exported.
The test document and Strong Test collection are not exported.
Example 3:
a. Create a file named cond.txt that contains create_date> DD/MM/YYYY
Example: create_date > 1/19/2011
create_date <11/25/2011
b. In a command line, run dsexport -r -c cond.txt Collection-X
This only exports the objects whose create date is between 1/19/2011 and 11/25/2011.
Examples using dsexport and -t option:
dsexport -r -t 20 Collection-10 — dsexport will fork 20 threads to export the tree of Collection-10. This will save approximately 20% exporting time.
dsexport -r -t 0 Collection-10 — dsexport will export the tree of Collection-10 without any thread. It is the
same as dsexport -r Collection-10.
CSV file export examples
dsexport -f csv Document — force an export in CSV format. If the export CSV file only contains the ISO-8859-1 character set, you can edit the CSV file using any text editor. If the export CSV file contains unicode characters, you should edit the CSV file using a unicode supported text editor. Otherwise, the Unicode characters in the CSV file may default to ? after saving the file.
dsexport -e Shift_JIS -f csv Collection-10 — export Collection-10 into CVS file using Shift_JIS encoding.
Behavioral nuances of dsexport
The command dsexport must analyze the repository data and convert it to a portable, text-based
representation. This section describes special behavioral conditions.
Objects with multiple parents
As an example, when exporting Collection-n, no parent links are exported. If Collection-m is within both
Collection-n and Collection-z (not part of Collection-n’s tree), then Collection-m is exported with source link references to Collection-n and to Collection-z. Collection-z is out of the scope of the operation and is not exported.
Guest and Administrator accounts
When exporting the Guest and Administrator accounts, only their user name property is exported. This restriction is in place as a security measure. The Guest user name is always exported as “Guest” and the Administrator user name is always exported as “admin”, independent of their current user name values in
the repository. This is required to enable dsimport and other tools to reliably identify these accounts.
Exporting to CSV
• dsexport exports a single version for each document. If the document has multiple versions, the version designated as the preferred version is the one exported to CSV.
• dsexport does not export any ACLs. When CSV-exported objects are imported using dsimport, they are assigned new ACLs by the new importing location or default if dsimport does not involve a location.
Exporting to XML
• All document versions are exported to XML
• ACLs are exported to XML
Solution Updated: April 21st, 2014
Solution ID: 492