Lantronix SGX 5150 IoT Device Gateway SGX 5150 Command Reference - Page 20

Importing and Exporting an XML Configuration File, Best Practices, Exporting

Page 20 highlights

4: Configuration Using XML Importing and Exporting an XML Configuration File An XCR can be imported or exported using the following methods:  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 SGX 5150 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 from an external source such as your local hard drive.  FTP The SGX 5150 IoT device gateway FTP server can export and import XCRs when an FTP get or put command on the filename (sgx5150.xcr for export, sgx5150_import.xcr for import; both are under the pwxcr directory) is requested. On export (FTP get of sgx5150.xcr), the FTP server obtains the current XCR from the SGX 5150 IoT device gateway and sends it as a file. On import (FTP put of sgx5150_import.xcr), the FTP server processes the file by sending it directly to the XML engine. In both cases the SGX 5150 file system is not accessed. The files sgx5150.xcr and sgx5150_import.xcr are not read from or written to the file system. See the FTP section in the SGX 5150 IoT Device Gateway User Guide (available at www.lantronix.com/support/documentation.) 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 Web. See Importing and Exporting an XML Configuration File above to import and export using Web Manager, the CLI or FTP. Caution: Using Microsoft Word to edit and save an XCR will change the format of the file and make it incompatible with the SGX 5150 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. Exporting Using the Web Manager interface, select from "Lines to Export" and "Groups to Export" filters and select from either "Export to Browser" or "Download (from link)" option. Save the output to your local file system. Importing Modify the exported file by removing "configgroup" records and filling in any required secret data such as passwords, and private keys. Using the Web Manager, import the updated clone by uploading it from your local file system. SGXTM 5150 IoT Device Gateway Command Reference 20

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257

4: Configuration Using XML
SGX
5150 IoT Device Gateway Command Reference
20
TM
Importing and Exporting an XML Configuration File
An XCR can be imported or exported using the following methods:
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 SGX 5150 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 from an external source such as your
local hard drive.
FTP
The SGX 5150 IoT device gateway FTP server can export and import XCRs when an FTP get
or put command on the filename (
sgx5150.xcr
for export,
sgx5150_import.xcr
for
import; both are under the
pwxcr
directory) is requested. On export (FTP get of
sgx5150.xcr
), the FTP server obtains the current XCR from the SGX 5150 IoT device
gateway and sends it as a file. On import (FTP put of
sgx5150_import.xcr
), the FTP
server processes the file by sending it directly to the XML engine. In both cases the SGX 5150
file system is not accessed. The files
sgx5150.xcr
and
sgx5150_import.xcr
are not
read from or written to the file system. See the FTP section in the
SGX 5150 IoT Device
Gateway User Guide
(available at
www.
l
antronix.com/support/documentation
.)
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
Web. See
Importing and Exporting an XML Configuration File
above to import and export using
Web Manager, the CLI or FTP.
Caution:
Using Microsoft Word to edit and save an XCR will change the format of
the file and make it incompatible with the SGX 5150 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.
Exporting
Using the Web Manager interface, select from "Lines to Export" and "Groups to Export" filters and
select from either "Export to Browser" or "Download (from link)" option. Save the output to your
local file system.
Importing
Modify the exported file by removing "configgroup" records and filling in any required secret data
such as passwords, and private keys. Using the Web Manager, import the updated clone by
uploading it from your local file system.