Blog · Configuration
Switch and router config backup: how to automate it and never lose a version.
Automatic configuration backup means the system itself collects the running config from every device on a schedule and after every change, stores it as a new version, masks the passwords and shows the differences. Manual copies to a TFTP server and cron scripts work until the first outage, when the last copy turns out to be six months old.
Why manual backup fails
In many networks, configuration backup is still a copy running-config tftp: done "when there is time", or a script someone wrote years ago. It works as long as nobody looks at it. The problems are always the same:
- Missing devices. A new switch went into the rack but not into the script's list. Its copy is missing until the day you need it.
- A copy from before the change, not after it. A daily backup misses three changes made during the day, and the one somebody reverted by hand before evening.
- Passwords in plain text. A full config holds SNMP secrets, TACACS+ keys and local account passwords. It sits on a file server half the department can read.
- Files instead of history. A folder of
sw07-final-v2.txtfiles does not say what changed, when, or who did it. - Nobody checks that it works. The script stopped logging in after a password change six months ago, and nobody noticed.
What good configuration backup does
A copy is only the start. The value is a version history you can read, compare and safely go back to.
- Collects configs automatically from every device in the inventory, on a schedule and also after every change.
- Logs in with a read-only account. A backup tool needs no right to change anything.
- Masks secrets before the config leaves the site, not later in the database.
- Stores versions instead of overwriting a file. Each version with its date, device and where it came from.
- Shows the differences between any two versions, like
diffin version control. - Compares against a standard. Deviation from your agreed baseline, configuration drift, should be visible without searching.
- Alerts when a backup fails. A missing backup is an event too.
Example: the VLAN that vanished after a switch swap
On Friday evening, a technician replaces a failed access switch. They load the config from a template, everything comes up, the ports are green. At eight on Monday morning, the cameras on one floor have no picture.
Without config history, the guessing starts: cameras, recorder, cabling, PoE power. With history, you compare the last version before the swap with the current one:
--- access-sw-07 · v41 · 7 Nov 2026, 22:00 (nightly backup) +++ access-sw-07 · v42 · 8 Nov 2026, 08:47 (after the swap) interface GigabitEthernet1/0/48 description UPLINK-DIST-02 switchport mode trunk - switchport trunk allowed vlan 10,20,30,110 + switchport trunk allowed vlan 10,20,30
The template did not know VLAN 110, where the cameras live. The diff shows the cause in seconds, and the fix is one line on the uplink. Without Friday's backup, there would be nothing to compare against.
Backup is half of it. The other half is a safe way back
A copy is only worth something if you can use it without risk. Restoring an earlier version is also a change on a production device, so it should take the same path as any other: drafted from the version diff, approved, pushed with automatic rollback (commit confirmed) if the device loses connectivity, and verified afterwards. We will cover commit confirmed in its own post.
A checklist for your network
- Do you have a config copy for every device in the inventory, including those added last month?
- How many hours old is the oldest "latest" copy?
- Do your copies hold passwords and secrets in plain text? Who can read them?
- Can you show, within a minute, what changed on a given device last week?
- Do you know which devices deviate from your configuration standard?
- Does anyone hear about it when a backup fails?
If the answer to two or more is "I don't know", your configuration backup is a set of files rather than a safeguard.
How Gravity does it
Gravity collects the running config of every device over SSH with a read-only account, daily and after every change pushed through Gravity. Passwords and secrets are masked on site, by the collector, and device credentials never leave the site. Every version is kept, and the device view shows the running config, the standard and the differences between them. You describe your standards once, such as NTP and syslog servers or hardening rules, and Gravity checks them on every device. Changes, including going back to an earlier version, go through approval, commit confirmed and verification, and every step is audited.
See Gravity at launch in 2027
Gravity launches in 2027 as a single VM for about a hundred devices. Sign up and we will invite you to the launch.
Sign up for the launch