Skip to content

Compare two files or configs

Compare (added in 4.5.0) shows the differences between two texts: two config backups, a backup and the current config, or a file and something you copied. It opens as a read-only diff in a Workbench tab, side by side or inline, with changed words highlighted and long unchanged stretches collapsed.

  1. Open a new tab with + or Ctrl+T.
  2. Under TOOLS, click Notepad, then Compare files….
  3. In the first Windows dialog, pick the first (original) file.
  4. In the second dialog, pick the file to compare it with.

The original is on the left and the second file on the right.

  1. Open the file in Notepad.
  2. Right-click its tab and point to Compare with. The same menu is in ☰, File.
  3. Pick what to compare it with:
    • File… to choose a file on disk.
    • Clipboard to compare with the text you last copied.
    • The name of another open Notepad tab.

The Notepad tab is the left side.

A typical job: check what changed on a FortiGate since your last backup.

  1. Download a fresh backup with Quick transfer, for example sys_config from NWL-HQ-FW01.
  2. In Notepad, open last month’s backup of the same firewall.
  3. Right-click its tab, point to Compare with, click File…, and pick the fresh download.
  4. Press F7 to step through each change.

You can also compare live output without saving anything. Run show full-configuration on one device, right-click the terminal tab and click Open output in editor. Do the same on the second device, then use Compare with and pick the first tab. This works well for an HA pair like NWL-HQ-FW01 and NWL-HQ-FW02.

Compare view in Side by side mode showing two versions of a FortiGate config, with the changed lines and words highlighted

The toolbar across the top has:

  • ◀ Previous and Next ▶ to move between changes (Shift+F7 and F7), with a counter such as Change 3 of 12, or No differences.
  • Side by side for two columns, or Inline for one column with the removed lines from the left and the added lines from the right together.
  • ⇄ Swap to swap the two sides.
  • ⟳ Refresh to re-read the sides that are open Notepad tabs.

If the two texts are very different, ≈ approximate appears: the diff is still shown, but it’s a best effort.

The view is read-only. You can still select and copy text from either side. The same FortiOS and Cisco IOS highlighting as Notepad is applied.

The same compare in Inline mode, with removed and added lines shown together in one column