4: Configuration Using XML
EDS-MD® Wired IoT Device Gateway Command Reference
19
Importing and Exporting an XML Configuration File
An XCR can be imported or exported using the following methods:
Filesystem-XCRs can be saved to the wired IoT device gateway file system and imported or
accessed as needed. See
or the Filesystem Browser section in the
EDS-MD Wired IoT Device Gateway User Guide.
CLI-XCRs can be imported (captured) or exported (dumped) directly to a Telnet, SSH, or
serial line CLI session. Capturing an XCR can be started by pasting a valid XCR directly into
the CLI prompt. The EDS-MD 4/8/16 wired IoT device gateway immediately processes the
configuration record, changing any settings specified. This can be done on any level, including
the root. Special tags in the XML allow for providing root and enable level passwords so that
this can also be done at the password prompt.
Web browser-Web Manager can be used to import and export an XCR to the wired IoT device
gateway file system. It can also be used to import an XCR from an external source such as
your local hard drive.
FTP-The wired IoT device gateway FTP server can export and import XCRs when an FTP get
or put command on the filename (edsmd.xcr for export, edsmd_import.xcr for import; both are
under the pwxc directory) is requested. On export (FTP get of edsmd.xcr), the FTP server
obtains the current XCR from the EDS-MD 4/8/16 wired IoT device gateway and sends it as a
file. On import (FTP put of edsmd_import.xcr), the FTP server processes the file by sending it
directly to the XML engine. In both cases the wired IoT device gateway filesystem is not
accessed. The files edsmd.xcr and edsmd_import.xcr are not read from or written to the file
system. See FTP in the
EDS-MD Wired IoT Device Gateway User Guide
.
Best Practices
You can import or export an entire XCR, or just a portion of it, by specifying the group name and/or
group instances. In the examples below, import and export operations are performed from the CLI
on the local filesystem and require a XCR on the local filesystem. The Web Manager provides the
same functionality.
Caution:
Using Microsoft Word to edit and save an XCR will change the format of
the file and make it incompatible with the EDS-MD 4/8/16 wired IoT
device gateway. This is true even if the file is saved as Plain Text (.txt) or
an XML Document (.xml). Notepad, a third party text editor, or a
specialized XML editor should be used instead.
Importing
The following syntax can be used to import configurations from a file:
xcr import <file>
xcr import <file> <groups and/or group:instances>
The first line imports all groups specified in the XML config record named in <file>. Any filename is
valid, and the file name and extension are not important.
In the second line:
Instance follows group with a colon (see the third example on the next page).
Multiple groups are separated with a comma.