Skip to main content
RunBook Academy

CephXCIX · Upgrade PlanningUpgrade Planning

What to back up before an upgrade, and what a backup cannot do

Advanced⏱ ~18 mincephcrushtool

What you'll learn

  • Identify what is worth backing up
  • Understand what each backup enables
  • Recognise what backup cannot recover
  • Verify the backups are usable

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

The word “backup” in an upgrade plan often means two very different things, and conflating them produces a plan that does not work.

Two distinct things

BackupEnables
Configuration and metadatarebuilding the cluster’s shape on new storage
Datarestoring what the cluster served
Configuration backup is small, fast, and always worth taking.
Data backup is large, slow, and is the application's own concern.
An upgrade plan needs to be clear about which it has.

Configuration and metadata

BK=/backups/ceph-pre-upgrade
mkdir -p "$BK"

ceph auth export                 > "$BK/auth-export.txt"
ceph osd getcrushmap -o "$BK/crush.bin"
crushtool -d "$BK/crush.bin"     -o "$BK/crush.txt"
ceph config dump                 > "$BK/config.txt"
ceph osd pool ls detail          > "$BK/pools.txt"
ceph fs dump                     > "$BK/fs.txt"
ceph mon dump                    > "$BK/monmap.txt"
ceph orch ls --export            > "$BK/services.yaml"
ceph orch host ls --format yaml  > "$BK/hosts.yaml"
chmod 600 "$BK"/*

The auth export contains every key in the cluster and is the single most sensitive file a Ceph operator handles.

What each enables

FileEnables
auth-export.txtrestoring client access without reissuing every key
crush.txtrecreating the topology and rules
config.txtrestoring tuning that was set explicitly
pools.txtrecreating pools with the same parameters
services.yamlredeploying the same service layout via cephadm
hosts.yamlreconstructing the host inventory
# the service spec is directly re-appliable
ceph orch apply -i "$BK/services.yaml"

What backup cannot recover

None of the above restores data.
A restored configuration on empty OSDs is an empty cluster with the
right shape.
LossRecoverable from config backup
A pool deletedno — the shape returns, the objects do not
OSD data corruptedno
The monitor store lost with all copiespartially; the OSD map can be reconstructed from OSDs in some cases
A CRUSH rule changed badlyyes
Config tuning lostyes
Client keys lostyes
This is why the data protection question is answered separately, by
application-level backups, mirroring, or a second cluster — not by the
upgrade plan.

Verifying the backups are usable

# the CRUSH map recompiles
crushtool -c "$BK/crush.txt" -o /tmp/crush-verify.bin && echo "crush OK"

# the service spec parses
python3 -c 'import yaml,sys; yaml.safe_load(open(sys.argv[1])); print("yaml OK")' \
  "$BK/services.yaml"

# the auth export is complete
grep -c '^\[' "$BK/auth-export.txt"
ceph auth ls --format json | python3 -c '
import sys,json; print(len(json.load(sys.stdin)["auth_dump"]))'
The two counts should agree. A truncated auth export is a backup that
looks fine until it is needed.

Quiz

Knowledge check · 4 questions

  1. Q1. What does restoring a Ceph configuration backup onto rebuilt OSDs produce?

  2. Q2. A pre-upgrade configuration backup satisfies the data protection requirement.

  3. Q3. Verify pre-upgrade backups are usable.

    The team has captured the configuration backup files before an upgrade and wants to confirm they would work.

  4. Q4. Why is `ceph auth export` the most sensitive file a Ceph operator handles?

Passing score: 75%. Answers are checked in this browser.

Production discipline

Be explicit in the upgrade plan about which kind of backup exists. Configuration backup restores the cluster’s shape and is always worth taking; data protection is a separate concern answered by application backups or mirroring. Verify the CRUSH map recompiles and the auth export count matches before relying on either.

Cross-course references

  • Kubernetes: etcd backup restores cluster state, not the PersistentVolume contents
  • Linux: configuration backup and data backup are distinct disciplines