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
- Quiesce writers and run
forgejo --config /path/to/app.ini dumpas the service user, with the same work path as the service; do not set skip flags. - 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.
- 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.
