Using the CLI : Tips & tricks : Editing the configuration file in a text editor
 
Editing the configuration file in a text editor
Editing the configuration file with a plain text editor can be time-saving if:
you have many changes to make,
are not sure where the setting is in the CLI, and/or
own several FortiWeb appliances
This is true especially if your plain text editor provides advanced features such as regular expressions for find-and-replace, or batch changes across multiple files. Several free text editors are available with these features, such as Text Wrangler and Notepad++.
 
Do not use a rich text editor such as Microsoft Word. Rich text editors insert special characters into the file in order to apply formatting, which may corrupt the configuration file.
To edit the configuration on your computer
1. Use execute backup cli-config or execute backup full-config to download the configuration file to a TFTP server, such as your management computer.
2. Edit the configuration file using a plain text editor that supports Unix-style line endings.
 
Do not edit the first line. The first lines of the configuration file (preceded by a # character) contains information about the firmware version and FortiWeb model. If you change the model number, the FortiWeb appliance will reject the configuration file when you attempt to restore it.
3. Use execute restore config to upload the modified configuration file back to the FortiWeb appliance.
The FortiWeb appliance downloads the configuration file and checks that the model information is correct. If it is, the FortiWeb appliance loads the configuration file and checks each command for errors. If a command is invalid, the FortiWeb appliance ignores the command. If the configuration file is valid, the FortiWeb appliance restarts and loads the new configuration.