How to program a Netonix Switch if you only have a config.txt file.

Prelude:-

Configuration of Netonix Switches can be backed up in a couple of different ways.

1) Use the GUI, Utilities / Backup option, this will output/save a file with a name something like 192.168.1.20_WS-12-250-AC_Netonix-Switch.NCFG.

2) Using a Configuration Backup program like Unimus, Rancid, or Telnet/SSH Scripting, which can save a config.txt file (output of the show config cli command).

Apparently there is no good documentation on how to restore the config to another switch if you have a backup done using option # 2 above.

It turns out to be rather simple on how to ‘restore’ a config if you have the output of show config cli command.

Process:-

1) Connect to the CLI using Web interface (Device / Console ) or your favorite Telnet / SSH client (putty etc) or Serial Connection.
2) Issue ‘cmdline’ command to drop down to the Busybox command line shell
3) You should be now at the :/www# prompt .. you can use ‘ls’ command to see the file list.
4) Use VI or nano to open up the config.json file … ‘vi config.json’ or ‘nano config.json’
5) You can delete all the exiting content and replace it with the contents of you backup (config.txt) file.
6) Save file, exit out of the editor.
7) Reboot your Switch.

Note: vi editor build-in in busybox is a limited version..
use ‘insert’ key to enter edit mode
use ‘dd’ to delete file
use <esc> key to exit edit mode
‘:wq’ to exit after saving the file edit
‘:q!’ to exit without saving file

Another alternative method :-
Do you backup and Restore using the Web GUI, which produces a .NCFG file. This is actually a tar.gz file. One can rename .ncfg file to .tar.gz, un-tar it, replaced the content of config.json file under the ‘www’ folder
re-create the tar.gz file again, and upload / restore the file to the switch.