3 Backup and Recovery
official-markus-maurer edited this page 2026-07-16 11:57:15 +02:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Backup and Recovery

Preservation fails if recovery is only theoretical. Apply the 3-2-1 rule as a minimum: three copies, two storage types, one geographically or administratively independent copy.

What must be backed up

  • Forgejo repositories, including PrivateServer-RS.git and PrivateServer-RS.wiki.git.
  • Forgejo database, configuration, attachments, issue/PR data, releases, packages, LFS objects, avatars where relevant, and action secrets through the platforms supported backup process.
  • Bare upstream mirrors, Git bundles, submodule mirrors, and Git LFS objects.
  • Public and restricted artifact stores with their access controls preserved.
  • Metadata catalog, checksum manifests, compatibility matrix, and restore runbooks.
  • Database schema artifacts and sanitized baseline fixtures.
  • Encryption keys required to read backups, stored separately and access-controlled.

The wiki is a separate Git repository. Backing up only the main source repository does not back up these pages.

The main repository contains a scheduled workflow that clones the wiki as a mirror, creates a Git bundle, verifies it, and publishes the bundle plus SHA-256 as a workflow artifact. This is a convenient checkpoint on the same Forgejo instance, not the independent copy required by 3-2-1.

Backup classes

Class Frequency Retention Example
Change-driven After important acquisition or release Permanent New client snapshot, dead upstream mirror, baseline release.
Daily incremental Daily 3090 days Wiki, metadata, active mirrors, Forgejo data.
Periodic full Weekly/monthly Rotating plus annual Entire preservation store.
Offline/immutable Monthly and after milestones Long term Write-protected disk, object lock, offline media.

Integrity routine

  1. Verify the backup tool completed and produced the expected inventory.
  2. Verify cryptographic hashes or repository checks.
  3. Compare object/file counts and total logical size with the source.
  4. Confirm restricted files did not become public or lose encryption.
  5. Record the check result in the backup inventory.

Restore drill

At least quarterly:

  1. Select one Git mirror, one large artifact, the wiki, and one baseline.
  2. Restore them to a clean, isolated destination.
  3. Run Git and checksum verification.
  4. Rebuild the working server/client environment from the restored inputs.
  5. Execute the baseline smoke test.
  6. Record duration, failures, undocumented dependencies, and corrective issues.

At least annually, restore the complete Forgejo instance into an isolated environment and confirm source, wiki, issues, releases, LFS, and permissions.

Use Runbook — Forgejo Recovery and track the first full drill in #6.

Recovery priorities

  1. Catalog, keys, and runbooks needed to understand the collection.
  2. Irreplaceable originals and dead-upstream mirrors.
  3. Forgejo metadata and collaborative history.
  4. Reproducible build dependencies and toolchains.
  5. Derived working copies, which should be regenerable.

Incident record

For corruption, loss, or accidental exposure, open a restricted incident record containing detection time, affected artifact IDs, last known good checksum, copy locations, access impact, recovery actions, and follow-up tests. Do not paste secrets or sensitive paths into public issues.