mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-08 20:46:44 +03:00
updated www articles
This commit is contained in:
@@ -5,6 +5,8 @@ description: "Archive commits, issues, releases, and LFS assets into Gitea so ho
|
||||
canonical: "https://gitea-mirror.com/use-cases/preserve-github-history/"
|
||||
---
|
||||
|
||||
# Preserve GitHub History Forever
|
||||
|
||||
## Keep the entire story, not just the code
|
||||
|
||||
GitHub accounts get banned, repos go private, and owners rage-delete history. If you care about the full timeline—issues, releases, wiki—Gitea Mirror snapshots everything on a schedule so the story survives in your homelab.
|
||||
@@ -20,29 +22,41 @@ GitHub accounts get banned, repos go private, and owners rage-delete history. If
|
||||
|
||||
### 1. Set archival-friendly defaults
|
||||
|
||||
In the admin UI under **Settings → Mirror Options**:
|
||||
In **Configuration → Connections**, open **Repository defaults**:
|
||||
|
||||
- Enable **Mirror metadata**.
|
||||
- Enable **Mirror releases** and **Mirror wiki**.
|
||||
- Turn on **Include attachments** so release assets and issue uploads copy across.
|
||||
- Enable **Mirror metadata** and choose the components you care about (issues, pull requests, labels, milestones, wiki).
|
||||
- Enable **Mirror releases** and raise the **Latest releases** limit if you need a deeper history of release assets.
|
||||
- Toggle **Git LFS (Large File Storage)** so binaries follow the repository, assuming LFS is enabled in your Gitea instance.
|
||||
|
||||
### 2. Create an "Archive" organization in Gitea
|
||||
|
||||
1. In Gitea, create an org like `github-archive` with read-only members.
|
||||
2. Back in Gitea Mirror, edit each owner and set the destination to the archive org.
|
||||
3. Enable **Lock mirrors** so accidental edits on the archive side are blocked.
|
||||
1. In Gitea, create an org like `github-archive` and grant read-only access to everyone who needs the history.
|
||||
2. Back in Gitea Mirror under **Configuration → Connections**, pick the **Preserve structure** strategy (or set a destination organization) so repos land in that archive org.
|
||||
3. Tighten permissions in Gitea—disable pushes for regular users so the archive stays immutable while the service updates it via its token.
|
||||
|
||||
<figure class="mt-8 flex flex-col items-center">
|
||||
<img
|
||||
src="/assets/repositories.png"
|
||||
alt="Repositories dashboard in Gitea Mirror showing archived GitHub projects synced into Gitea."
|
||||
class="w-full max-w-5xl rounded-xl border border-muted shadow-sm"
|
||||
loading="lazy"
|
||||
/>
|
||||
<figcaption class="mt-3 text-sm text-muted-foreground text-center">
|
||||
Keep every GitHub project visible in the repositories dashboard while routing mirrors into a dedicated archive organization.
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
||||
### 3. Choose retention & cadence
|
||||
|
||||
- Set the global interval to `1h` for active projects or `12h` for dormant ones.
|
||||
- Configure **Snapshot retention** (for example `keep last 30`) so old mirror runs remain inspectable.
|
||||
- Schedule a weekly full sync window during off-hours to re-check metadata drift.
|
||||
- In **Configuration → Automation**, enable **Automatic syncing** and set the interval (`1h` keeps fast-moving repos current; `12h` is usually enough for archives).
|
||||
- Turn on **Handle orphaned repositories automatically** and leave the action on **Archive** so anything deleted upstream is preserved locally but marked read-only.
|
||||
- Bump the **Latest releases** limit or run an occasional manual **Sync now** for milestone projects to capture older release assets.
|
||||
|
||||
### 4. Record provenance
|
||||
|
||||
- Tag each archived repo in Gitea with the upstream URL and the first mirrored date.
|
||||
- Enable **Mirror webhooks** to push sync summaries into Matrix/Discord for auditing.
|
||||
- Export a CSV of repos quarterly as part of your homelab documentation.
|
||||
- Add a README or label inside the archive organization that captures the upstream URL, first mirrored date, and token owner.
|
||||
- Export a CSV from the **Repositories** view or hit `/api/events` quarterly so you retain a human-friendly change log.
|
||||
- Store the configuration export (`/api/export`) alongside your disaster-recovery docs in case you need to rebuild the service.
|
||||
|
||||
### 5. Back up the backup
|
||||
|
||||
@@ -67,3 +81,17 @@ In the admin UI under **Settings → Mirror Options**:
|
||||
|
||||
- [Automate GitHub Backups](../github-backup-automation/)
|
||||
- [Build a Starred Repo Collection](../starred-repos-collection/)
|
||||
|
||||
## FAQ
|
||||
|
||||
### Does this preserve issues, pull requests, and releases?
|
||||
|
||||
Yes—enable Mirror metadata and Mirror releases in Repository defaults. Pull requests copy as enriched issues, keeping discussion and labels.
|
||||
|
||||
### What happens if a GitHub repo is deleted or goes private?
|
||||
|
||||
Turn on Handle orphaned repositories automatically and use Archive to keep a read-only copy locally. Delete enforces a strict mirror, removing the repo.
|
||||
|
||||
### How much storage will I need long-term?
|
||||
|
||||
Plan for repo size plus attachments and LFS. Monitor the mirror’s `data/` volume growth and consider ZFS/BTRFS snapshots or object storage for older archives.
|
||||
|
||||
Reference in New Issue
Block a user