TT Lab
Get started
Learn Learning paths Courses

Backup and Restore

Restore Rehearsal

Continue in TT Lab

Goal

Carry out a recovery rehearsal with the backup set you built earlier, and measure the time to determine whether the RTO is met.

Why it matters

Recovery is all about order and verification. Extracting directly with -C / without going through a temporary path is an irreversible operation, and breaking the incremental restore order makes files that should exist disappear. And the RTO is a wish until you actually measure it — the number one reason RTO is missed in practice is not slow extraction but failing to count the time to bring the backup over.

The recovery objectives for this lab are RPO 24 hours and RTO 300 seconds.

Steps

  1. Create the /root/rest directory, and write the following two lines to /root/rest/objective.txt. RPO=24h / RTO=300s
  2. Restore /root/bk/full.tar.gz to /root/rest/check/. You must not touch the current /root/bk/src.
  3. Compare the restored copy with the original recursively and save the result to /root/rest/diff.txt. (There may be differences because of the file you added in step 4, so you may limit the comparison to the conf and data directories.)
  4. Restore only src/app/conf.yaml from the archive to /root/rest/one/. There must be no other files in that directory.
  5. Use --strip-components to remove src/ from the archive and restore to /root/rest/stripped/. As a result, /root/rest/stripped/app/main.py must exist.
  6. Restore the incremental set in order. Extract full → inc0 → inc1, in that order, into /root/rest/inc/, and /root/rest/inc/src/app/new.py must exist.
  7. Perform the full recovery from step 2 through step 6 once more, timing it, and write the following two lines to /root/rest/timing.txt. ELAPSED=<초> / MEETS_RTO=<yes|no> (yes if within 300 seconds)
  8. Create /root/rest/report.txt with the following 5 lines. RESTORED_FILES=<2번 복원본의 파일 수> / SELECTIVE=1 / STRIPPED_OK=yes / INCREMENTAL_OK=yes / RTO_MET=<7번의 판정> (The placeholders stand for the seconds elapsed, the number of files in the step 2 restore, and the verdict from step 7.)

Notes

Record the recovery objectives

Create the /root/rest directory, and write the following two lines to /root/rest/objective.txt. RPO=24h / RTO=300s

The RPO and RTO are given in this lab. Write the values exactly.

Restore to a temporary path

Restore /root/bk/full.tar.gz to /root/rest/check/. You must not touch the current /root/bk/src.

Never extract directly into the current location. Use the option that specifies the restore location.

Compare with the original

Compare the restored copy with the original recursively and save the result to /root/rest/diff.txt. (There may be differences because of the file you added in step 4, so you may limit the comparison to the conf and data directories.)

There is a command that compares whole directories recursively. If there are no differences, it is silent.

Selective restore

Restore only src/app/conf.yaml from the archive to /root/rest/one/. There must be no other files in that directory.

If you pass the path inside the archive as an argument, only that is extracted. First confirm the exact path from the listing.

Restore with path adjustment

Use --strip-components to remove src/ from the archive and restore to /root/rest/stripped/. As a result, /root/rest/stripped/app/main.py must exist.

There is an option that specifies how many leading path elements to strip.

Restore in incremental order

Restore the incremental set in order. Extract full → inc0 → inc1, in that order, into /root/rest/inc/, and /root/rest/inc/src/app/new.py must exist.

You must extract the full backup first, then the incrementals in order. Do not update the snapshot file during a restore.

Measure the recovery time

Perform the full recovery from step 2 through step 6 once more, timing it, and write the following two lines to /root/rest/timing.txt. ELAPSED=<초> / MEETS_RTO=<yes|no> (yes if within 300 seconds)

Compute the difference between the start and end times in seconds. Compare it with the objective to reach a verdict.

Rehearsal report

Create /root/rest/report.txt with the following 5 lines. RESTORED_FILES=<2번 복원본의 파일 수> / SELECTIVE=1 / STRIPPED_OK=yes / INCREMENTAL_OK=yes / RTO_MET=<7번의 판정>

Gather the actual results of the earlier steps. The number of mismatches comes from the comparison result.