The export_settings and import_settings are CLI features that allow you to export/import the entire or partial (subtree or the configuration of a given path) configuration in a text format. The input and output can be a file or standard input/output (copy/paste). It can be used at the root of the configuration menus to get all of the settings, or at a specific level (i.e. 'cd /settings/network_connections' first) to get a more limited set. If you use the --file option, it will write to the home directory of the user you are logged in as.
export_setting options
export_settings [cli-path] [arguments]
where arguments can be:
--with-options - provide a list of choices for value
--include-empty - generate parameter line even if no value
--not-enabled - generate parameter line even if parameter not active
--plain-password - plain plain/hash password
--file <local-pathname> - output to a local file
import_settings options
import_settings [arguments]
where arguments can be:
--file <local-pathname> - local file input
--overwrite-tables - overwrite table when its configuration is given
--quiet - suppress report of success/failure per path, just output final counters.
In interactive mode (no --file given) the administrator can type the lines or paste them. The command is finalized by <ctrl>D
Below is an example to export the managed device named "dvs"
Exporting:
[admin@nd2 /]# export_settings /settings/devices/dvs/ --plain-password --file dvs_settings
If you want to export the passwords as well, use the option --plain-password
[admin@nd2 /]# export_settings /settings/devices/dvs/ --plain-password --file dvs_settings
The file named "dvs_settings" will be saved inside the user's home directory. In this case it is /home/admin. The file can be accessed by going to shell. From the shell you can use scp to transfer the file to another nodegrid or you can download it using filemanager tool available in the GUI. In the filemanager the path for the admin's home directory is /Home/admin_home
[admin@nd2 /]# shell
admin@nd2:~$ pwd
/home/admin
admin@nd2:~$ ls
dvs_settings
If you want other users to access the file you can save it under /var/sw. In the filemanager the directory name is /Home/software
[admin@nd2 /]# export_settings /settings/devices/dvs/ --file /var/sw/dvs_settings
Importing:
copy the file to admin 's home directory using scp or filemanager
[admin@nd1 /]# import_settings --file /home/admin/dvs_settings
Path: /settings/devices/dvs/access Result: succeeded
Path: /settings/devices/dvs/management Result: succeeded
Path: /settings/devices/dvs/logging Result: succeeded
Path: /settings/devices/dvs/commands/console Result: succeeded
Path: /settings/devices/dvs/commands/data_logging Result: succeeded
Path: /settings/devices/dvs/commands/web Result: succeeded
Processed paths: 6 Rejected paths: 0
If you try to import with another user you will get an error, since the other user will not have permissions to read the files in the /home/admin directory.
[test@nd1 /]# import_settings --file /home/admin/dvs_settings
Error: Invalid filename
Instead you can save the file to /var/sw
[test@nd1 /]# import_settings --file /var/sw/dvs_settings
Note: Also the user needs to have sufficient privileges to apply the settings