Forgejo backup and disaster recovery
A backup is a copy. Disaster recovery is getting a working forge back from that copy when the machine is gone. They fail in different places, and most teams find the gap during the outage. This guide is the decision-first version: what to protect, the questions that set your design, what proves a backup works, and what Fjord does on managed instances. The step-by-step procedures live in the Operations runbooks, linked where they apply.
Fjord sells managed Forgejo hosting, so we have a stake in how this reads. Claims about Forgejo cite Forgejo’s own documentation, opened on 2026-11-01. Claims about Fjord cite Fjord’s own pages and say what those pages do not state. Where we have not run something, the guide says so.
What a Forgejo backup has to hold
Forgejo’s own command-line page describes forgejo dump as compressing “all
related files and database into zip file” that “can be used for backup”. Unless
you pass a skip flag, the dump covers repositories, logs, the custom directory,
LFS data, attachment data, package data, the search index and repository archives,
as well as the database. See the
Two things to take from that:
- Repositories alone are not the forge. Issues, pull requests, users, permissions and settings live in the database. A set of Git clones gives you your history, and nothing else.
- A dump is not a restore. That page lists
restore-repofor restoring repository data and no command that restores a whole dump. Restoring means unpacking the archive, loading the SQL into a database of the same engine and a compatible schema version, and putting the files back where Forgejo expects them. Fjord’s backup runbook says not to assume a one-line restore exists for your version.
Take a backup before you upgrade as well. The
Forgejo upgrade guide says a full backup is "a requirement when upgrading to a new stable release" and "a good precaution" for minor and patch releases. It also says the database version is stored in the database to prevent an accidental downgrade, so a backup is your way back, not a downgrade command.Four questions that set your design
- How much can you afford to lose? A nightly dump leaves a gap of up to a day plus the time the job takes. If the dump runs while the forge is taking writes, treat it as crash-consistent at best: the database and the repositories are read one after the other and can describe different moments. Decide whether to quiesce writers, snapshot underneath, or accept the gap, and write it down. See Dump a quiet forge.
- How long can you be down? Only a timed restore answers this. Time to a failure is not a recovery time. Measure from fetching the backup to a passing check, and record what you sampled.
- Where do the copies live, and who can read them? Keep copies off the machine, encrypted before they leave it. The encryption key is the backup: keep the means to recover it somewhere that survives losing the machine.
- Who restores, and have they done it? A procedure nobody has run is a draft. Name the owner before the outage.
A backup that ran is not a backup that works
Each step of a backup pipeline has a failure that looks like success. The backup runbook covers them in depth. The ones that bite first:
- The dump may be empty, stale or corrupt. Check this run’s exit code, look for this run’s file by a unique name, and test the archive. If any check fails, upload nothing: a night with no snapshot is a loud problem, and a night with a corrupt one is a quiet problem you meet during the outage.
- Retention may never prune. A retention window that groups snapshots by a path that changes every run leaves every snapshot alone in its group, so nothing ages out and the repository grows while the command reports success.
- Silence looks like health. Report each success with its snapshot id and alert when the last success is older than the schedule plus a margin, not only when an error is logged.
- A report is not proof. It says a backup ran. Only a restore says it works.
The runbook sorts restore proof into three levels, and every drill should say which it reached:
| Level | What you do | What it proves |
|---|---|---|
| 1. Archive | Restore the latest snapshot into a scratch directory and test the archive. | The snapshot exists, decrypts and is readable. Not that Forgejo can use it. |
| 2. Semantic | Load the database into a scratch database, compare counts with a manifest taken at backup time, check each repository. | The database and repositories agree with each other and with what existed. |
| 3. Service | Start a throwaway Forgejo on the restored data, sign in, open a repository, download an attachment. | The thing you would cut over to works, and you have a measured recovery time. |
Run level 1 at setup and after any change to the backup path. Run levels 2 and 3 on a fixed schedule. Make drills safe: use a throwaway target with the network isolated, neutralise mail, webhooks, Actions and mirrors before first start, and never let cleanup touch the source backup.
Disaster recovery: when the machine is gone
The cold restore runbook is for the case where the machine has gone and the nightly backup is all that is left. Before you touch anything, it asks you to settle these:
- Is the machine really gone? A slow or unreachable forge is not a cold restore. Restoring over a forge that comes back leaves you with two forges and one hostname.
- How old is the backup, and are you inside the retention window? Read the date from the dump itself, and do not promise a restore past the point where backups are deleted.
- Can you reach the backup credentials for a forge that no longer exists? Credentials stored only on the lost machine are lost with it. Find the route before the outage.
- Who owns the incident? Name an owner and record the start time and what users see before you delete or recreate anything.
The path itself is: stop writers, restore into clean destinations, start, verify, and only then send people back. The follow-up page, cold restore: retries, fences and cutover, adds the part that is easy to miss. Restore with outbound effects fenced, because a restored forge that boots with live mail, webhooks and mirrors can repeat effects that already happened. It also separates the phase where a full reload is safe from the one where it is not.
Fjord’s own pages say how far that has been tested. The core runbook records one drill against a forge that was destroyed and rebuilt from its backup on a local reconstruction, where commits, users, keys and login matched. It also lists what that did not prove: the production storage provider and real provisioning time, TLS on a live hostname, and the shell blocks run end to end as one script. The hardening page, which adds retries, fences and cutover, says the whole of it has not been run against a real destroyed forge and should be treated as reviewed, not drilled. Read what a drill proved, and did not and that page’s last section before relying on any command.
What Fjord covers on managed instances
From Fjord’s backups page, as of 2026-11-01:
| Tier | Backups |
|---|---|
| Starter | No managed backups; keep your own copies (a clone is a backup). |
| Team | Nightly, encrypted, off-site backups with 90-day rolling retention. |
| Pro | Nightly, encrypted, off-site backups with 90-day rolling retention. |
Restore is requested through support with your instance and the snapshot you need. Recovery is from the most recent nightly snapshot within the 90-day window, and restore is operator-run. It covers Team and Pro instances, not Commons.
What those pages do not state, so do not assume it: a recovery time, a recovery point finer than the nightly snapshot, or a response time specific to a restore request. Fjord also has a page for published drill results,
fjord.sh/backup-drills. On 2026-11-01 it said "No drill results published yet", and it describes any result it shows as one drill, "not current service health or a contractual recovery guarantee".Your own copy, whoever hosts you
Because a Fjord instance is standard Forgejo, you can take your own copy at any time: clone or mirror your repositories, and use Forgejo’s built-in data export for repositories, issues and pull requests. Leaving Fjord lists what to export before closing an account or deleting an instance, since deletion removes the server and its backups on the published schedule. On Starter, or for anything critical, keep your own copy regardless of the plan.
A short checklist
- The latest snapshot is newer than your schedule plus a margin.
- The snapshot count levels off at the size your retention window implies.
- The last drill reached the level you promised and is within your cadence.
- You can name where the backup key is recoverable from if the machine is gone.
- A person, not a role, owns the restore and has seen the procedure.
Part of the Forgejo hosting guides. Related: Deploying Forgejo, Forgejo hosting costs, and Migrating to Forgejo. For the wider picture of what a provider takes over, see
Managed Forgejo hosting: what you hand over and what to ask.- Stephen Way