The XML Export tool is a command line wrapper of the XML export that you find in the swArchitect and swExplorer clients. Depending on your needs, it can be suitable to export meta model and/or metadata in the form of an XML file. Note that it is not possible to produce XMI or ReqIF file output. The tool is 64-bit. As this tool is not part of our standard delivery, to obtain it, contact [email protected]


Prerequisites

  • Server, port and login information for the database from which you want to export.
  • An installation of the swXMLExport tool including all necessary dll files.
    Note: In pre-R40 versions, the tool is called swExport.
  • The machine on which you are running the command must have sufficient RAM. Example: very large structure exports including all versions (95,000 items) and all attachments (584 MB attachment file structure) could be completed in approx. one hour with a 16 GB laptop.


Installing the Tool 

Save the swXmlExport directory to a suitable location on your drive. The directory should contain the following files: 

Note: Prior to the Sävenäs (R47) release, the SystemWeaver.swXmlExport executable was called simply swXMLExport. 

Creating the Command Line

Below are two example command lines to illustrate how to include parameters: 


Example 1

Exports an xml file containing the meta model and all config items:

SystemWeaver.swXmlExport.exe -XmlFileName=c:\temp\MMExport.xml -ExportConfigItems=true -ServerName=sys7 -ServerPort=1345 -ServerUserName=XXX -ServerPassword=XXX


Example 2

Exports an xml file that does NOT contain the meta model (ExportMetadata) (You may want to exclude it if the target database is already prepared with a compatible meta model). It also excludes plain descriptions (This may be excluded if, for example, the import will use the formatted descriptions). The export will include previous versions and attachments: 

SystemWeaver.swXmlExport.exe -XmlFileName=c:\Temp\Export.xml -ServerName=abc23 -ServerPort=3022 -ItemId= -IncludePreviousVersions=true -ExportMetadata=false -IncludeAttachments=true -ServerUserName=XXX -ServerPassword=XXX


Optional and Mandatory Parameters

Below are all available parameters for command line XML export. In release Sävenäs (R47) and later, a dash (-) must precede the parameter in the command line


ParameterDefinitionExpected value typeExample
ServerPortRequired. The port of SystemWeaver server 
Integer-ServerPort=1768
ServerNameRequired. The name or IP address of SystemWeaver server
String
-ServerName=localhost
ServerUserNameThe SystemWeaver username to connect with. 
String-ServerUserName=user
ServerPasswordThe SystemWeaver password to connect with. 
String-ServerPassword=pass
UseNetworkAuthentication
Optional. To use instead of ServerUserName and ServerPassword. Default=false.
Boolean-UseNetworkAuthentication=true
XmlFileNameRequired. The name for the output file.String-XmlFileName=D:\Work\test.xml
ItemId

Optional. Specifies the xID of the item for which the configuration applies.

SystemWeaver xId-ItemId=x0000001D04533514
IncludeLaterVersions

Optional. Default=false. Include all later

versions of an item depending on which is used. 

Boolean-IncludeLaterVersions=true
IncludePreviousVersions

Optional. Default=false. Include all previous

versions of an item depending on which is used. 

Boolean-IncludePreviousVersions=true
ExportMetadataOptional. Default=true. Include all metadata.
Boolean-ExportMetadata=false
ExportConfigItems

Optional. Default=false. Include the config items.

Boolean-ExportConfigItems=true
IgnoreErrorsOptional, Default=false
Boolean-IgnoreErrors=true
IncludePlainDescription

Optional. Default=false. Include the description values as unformatted text as well. 

Boolean-IncludePlainDescription=true
IncludeAttachments

Optional. Default=false. Include all

attachments for the chosen items.

Boolean-IncludeAttachments=true
IncludeItemOwner

Optional. Default=false. Include the owner element of each item in the xml export. 

Boolean-IncludeItemOwner=true
IncludeBigImages

Optional. Default=true. Include all big images for the chosen items.

Boolean-IncludeBigImages=false
SwapInForeignId

Optional. Default=false. Replaces the id

attribute in the exported XML with the ForeignID property of the items and parts if there is any.

Boolean-SwapInForeignId=true
ForeignIdNamespace

Optional. Include a "namespace" string that will

be used as a prefix of exported ids.

String-ForeignIdNamespace=DB1_QA
ConfigFileOptional. Specifies a configuration file to use.
String-ConfigFile=C:\Exports\config.xml
ConfigID

Optional. Specifies the ID of the configuration

in the application config to read from the server.

String
-ConfigID=
LogFileDirectoryOptional. Default is the current directory.
String-LogFileDirectory=C:\Work
NoLogFileOptional. Default=false.
Boolean-NoLogFile=true


Tip: -h, -?, and --help show all parameters and descriptions.


Example 3

Export only the meta model.

SystemWeaver.swXmlExport.exe XmlFileName=c:\temp\test.xml ServerName=sys7 ServerPort=1111 ServerUserName=XXX ServerPassword=XXX


Using a Config File

There is an option to use a configuration XML file placed in the same directory as the tool, instead of setting the options directly in the command line. 



There are also currently more options when using a configuration file, e.g., IncludedParts. See System Default Settings for XML Export for a list of the settings that can be used in a configuration file. Below is an example command line that uses a configuration file called config.xml and the content of the example config file is shown below.


SystemWeaver.swXmlExport.exe XmlFileName=C:\exports\2023export.xml ServerName=sys7 ServerPort=1111 ServerUserName=XXX ServerPassword=XXX ConfigFile=C:\exports\configs\config.xml


Example File

<ExportToXMLConfig id="AB1 2023 Export" sid="I">
  <IncludedParts>XESX</IncludedParts>
  <IncludePlainDescriptionsValue>True</IncludePlainDescriptionsValue>
  <IncludeAttachmentsValue>True</IncludeAttachmentsValue>
</ExportToXMLConfig>

Things to Consider

  • If you are exporting a large amount of data, your export could effect performance for other system users. Keep this in mind when scheduling your export
  • A list of any errors will be included in the log file, and can be used to take action in resolving them if desired.
  • If a file already with the same name exists in the export location, it will be overwritten. 


Example of a Completed Export Command

To use the tool, run your command line from the location of the executable and related files.