Forgejo backup and restore

Capture a Forgejo dump along with anything whose location is defined outside the standard instance directories.

Last updated

On this page (5)

Forgejo ยท Backup and restore

Before you start

  • Forgejo service user, effective work path and app.ini.
  • Matching Forgejo release and isolated database.
  • Access to any external artifact storage.

Procedure

  1. Quiesce writers and run forgejo --config /path/to/app.ini dump as the service user, with the same work path as the service; do not set skip flags.
  2. Inspect the archive and inventory the SQL, repositories, custom files and storage objects. Capture any missing external mounts or buckets (for example LFS, attachments or packages) along with the effective configuration.
  3. Unpack into scratch space; import the archive SQL into a fresh database using the matching database engine, or restore a separately captured engine-native dump. Place repositories, config and data at the target paths specified by app.ini, set service ownership, redirect storage to test destinations, then start the matching release.

Verify the result

  • Clone a known repository and compare a commit hash and tags.
  • Fetch a known LFS object and package or attachment if used; verify a known issue is present.

Official documentation

Have Pilae operate Forgejo

We agree what to monitor, how to recover and who responds when something breaks. Bring your existing deployment or start with a new one.