CLI Backup and Restore — diff all Workflow

The Betaflight CLI is the only source of truth for a complete build configuration. Configurator tabs show most settings, but the CLI exposes everything — including defaults that the GUI hides. Before any tune experiment, back up with diff all. After a session, back up again.


Why diff all Instead of dump

flowchart LR
    DUMP[dump] -->|All settings<br/>including defaults| LARGE[Large file<br/>Hard to read<br/>Contains noise]
    DIFF[diff all] -->|Only non-default<br/>settings| SMALL[Small file<br/>Easy to review<br/>Only what matters]
    DIFF2[diff] -->|Non-defaults for<br/>current profile only| PROFILE[Profile-specific<br/>Misses OSD and other global settings]
CommandWhat it savesBest for
dumpEverything, including defaultsFull factory-level backup
diff allOnly your changesDay-to-day tuning backup
diffChanges in current profileQuick per-profile snapshot

Use diff all for every backup. It's readable, fits in a text file easily, and restores cleanly to the same Betaflight version. Use dump only when you need a byte-for-byte clone of an entire FC, or when transferring config to a different FC of the same model.


Backup Workflow

flowchart TD
    A([Open Betaflight<br/>Configurator]) --> B[Connect FC via USB]
    B --> C[Click CLI tab]
    C --> D["Type: diff all<br/>Press Enter"]
    D --> E[Wait for output to finish]
    E --> F["Click 'Save to File'<br/>or select all + copy"]
    F --> G[Name the file:<br/>build-name_date_purpose.txt]
    G --> H[Store in build folder<br/>or git repo]

In CLI:

1# Generate the backup
2diff all
3
4# The output scrolls in the terminal.
5# Click "Save to File" in Configurator, OR:
6# Select all output text (Ctrl+A in the text area), copy, paste to a .txt file.

Name the file with context — not just backup.txt:

1pavo20_2026-07-13_pre-tune.txt
2pavo20_2026-07-13_post-pid-tune.txt
3freestyle5_2026-07-10_working-config.txt

Restore Workflow

1# In CLI tab, paste the diff all contents and press Enter
2# Or use "Load from File" button
3
4# After pasting, always end with:
5save
6
7# Then power cycle the FC (unplug USB, replug)

Betaflight processes each CLI command in sequence. A diff all file is a series of set commands plus profile and rateprofile switching commands — it's valid CLI input.


Safe Tune Experimentation

Use this pattern to try a new tune without fear of losing what worked:

flowchart TD
    A[Backup current config<br/>diff all → save file] --> B[Make PID changes<br/>in Configurator or CLI]
    B --> C[Fly and test]
    C --> D{Better or worse?}
    D -->|Better| E[Save new baseline<br/>diff all → new file]
    D -->|Worse| F["Paste old diff all<br/>→ save → power cycle<br/>Instant rollback"]
    F --> B
1# Before any tune experiment:
2diff all
3# → Save to file immediately
4
5# After a bad tune:
6# Open the saved file, paste all contents into CLI, press Enter, then:
7save
8# Done — you're back to the working tune.

What diff all Captures

  • All PID values and TPA settings
  • All rate profiles (RC Rate, Super Rate, Expo for all axes)
  • All OSD element positions
  • Failsafe configuration
  • ESC/motor protocol settings
  • RPM filter configuration
  • All mode assignments
  • Blackbox settings
  • VTX power table
  • GPS settings (if configured)

It does NOT capture:

  • Receiver bind (stored on the RX)
  • VTX channel/power current selection (channel/power is runtime state)
  • Motor order/direction (stored in ESC firmware)

Storing Configs in Git

For serious builds, put your diff all files in a git repository:

 1mkdir quad-configs && cd quad-configs
 2git init
 3cp pavo20_2026-07-13.txt .
 4git add .
 5git commit -m "Pavo20: pre-tune baseline"
 6
 7# After a tune session:
 8cp pavo20_2026-07-14_after-pid.txt .
 9git add .
10git commit -m "Pavo20: P/D tuned, filter lowpass moved to 150Hz"

git diff between two configs shows exactly what changed — every set line that moved. This makes it trivially easy to understand what a tune session actually modified.


Recovering from a Bricked Config

If the FC won't arm or behaves strangely after a paste:

1# In CLI:
2defaults nosave     # resets all settings but does NOT save — lets you verify first
3# Verify arming works in Configurator
4save
5# Now paste your last known-good diff all

defaults nosave is reversible — save makes it permanent. Always test before saving.

Related Snippets