Back to lessons

Hosting Operations

Diff Restored Config Against Expected

You need to compare a restored configuration file with the expected fixture copy.

Command

cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full && diff -u expected/app/config.yml restore-sandbox/full/app/config.yml

What changed

The archive is extracted under restore-sandbox/full; diff only reads files.

Danger

caution

When to use it

Use when restored configuration must match a known-good expected file.

When not to use it

Do not diff secrets into public logs; choose non-sensitive config or redact first.

Undo or recovery

Remove the restore-dr/restore-sandbox/full directory from the fixture copy.

Expected output

No diff output when the restored config matches expected.

demo script

Disposable terminal steps

  1. cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full
  2. cd restore-dr && diff -u expected/app/config.yml restore-sandbox/full/app/config.yml

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full
::exit-code::0
$ cd restore-dr && diff -u expected/app/config.yml restore-sandbox/full/app/config.yml
::exit-code::0

YouTube Short

Diff restored config.

After extraction, compare critical config against the expected copy. No diff is the boring result you want.

LinkedIn hook

A restored config can exist and still be the wrong config.

Question: Which restored config files do you diff during DR drills?

experiments

A/B tests to run

Metric: completion_rate

A: Existing is not matching.

B: Diff restored config before trusting it.