Technical Anshu
Tutorials Blog
💾 GitLab Backup

Back Up Your Self Hosted GitLab or It Is Only a Demo

The day the server disk dies, your backup is either a restore or a rumour. GitLab concentrates everything your team cannot recreate - so its backup deserves the same seriousness as the server itself.

✍️ Technical Anshu🦊 GitLab CE on TurnKey Linux⏱️ 7 minute read
🎥 Watch the install in the video, then protect it with the backup routine in this guide

Here is the uncomfortable truth about a code server: every developer having a clone protects only the current state of the code. The history of who changed what, the issues, the merge request discussions, the user accounts, the attachments and the settings exist in exactly one place - GitLab's database and storage, inside one virtual machine. If that machine dies unbacked-up, the code survives in pieces and the team's memory does not. A backup is not a feature you add later. Without one, what you have installed is a demo.

What a real GitLab backup must contain
✔ Repositories with their complete history
✔ The database - users, projects, issues, merge requests
✔ Uploads, attachments and avatars
✔ Server configuration and secrets
✘ A developer's local clone - code only, no teamwork history

👆 Miss any green row and the restore will expose the gap at the worst possible moment - during the recovery itself.

1

Use the Backup Built into the Appliance - TKLBAM

TurnKey appliances ship with their own backup system, TKLBAM - TurnKey Backup and Migration - reachable through the appliance's administration tools. Configure it on day one, not after the first scare, and schedule it daily for a team that pushes code every day. Two details decide whether it saves you later. First, the backup is encrypted with a passphrase: store that passphrase in the same password manager as your root passwords, because an encrypted backup whose passphrase is lost is just a brick. Second, point the backup at storage that is not the server itself - an external drive, a NAS, or cloud storage - which the next rule explains.

2

A Snapshot Is Not a Backup

Virtual machine snapshots feel like backups and are not. A snapshot lives on the same host and the same disks as the server it protects, so the failure that kills the server usually kills the snapshot in the same minute. Snapshots are perfect for the hour before a risky change - take one before an upgrade, delete it after. A backup is a copy that has left the machine: synchronised to another device, on a schedule, with older copies kept. And one copy should leave the building entirely, because fire and theft do not respect your folder structure.

3

Respect the Same-Version Rule

GitLab has a strict, documented rule that surprises everyone once: a GitLab backup can only be restored onto the same GitLab version and edition it was taken from. This shapes two habits. Write the GitLab version next to every backup you keep, so a future restore starts with the right appliance. And always take a fresh backup immediately before an upgrade, because if the upgrade goes wrong, that same-version backup is your only clean road back. Teams discover this rule during disasters. You are reading it now, which is the cheaper way.

4

Test the Restore Once, Before You Need It

Spin up a throwaway virtual machine, install the same appliance, restore your backup into it, sign in, and open a project. The whole exercise takes an afternoon the first time and teaches you every step your future stressed self will need. If something in the chain is broken - a forgotten passphrase, a missing configuration file - you find out on a quiet day with coffee, not during an outage with the team standing behind you. An untested backup is a hope, not a plan. After the test, put the date in your calendar and repeat it when the appliance version changes.

🔴 The most common small-team disaster is not hacking. It is a dead disk, plus a backup folder that was also on that disk. If your backups have never left the server, you do not have backups yet - you have copies of the problem.

🎥 Watch the Complete Process in the Video

Watch the complete install in the video, then give it the backup it deserves before the first real project moves in.

▶️ Watch Full Video
❓ Common Questions (FAQ)

How often should GitLab be backed up

Daily for a team pushing code every day; weekly is the bare minimum for a quiet instance. Automate it either way - manual backups are precisely the ones forgotten during busy weeks.

Every developer has a clone. Is that not a backup

It protects the code's current state only. Issues, merge request discussions, project settings, user accounts and attachments exist only on the server. Lose the server and the team's memory goes with it.

How big will a GitLab backup be

Roughly the size of your repositories plus uploads and the database. Check the trend monthly: a backup that suddenly doubles usually means someone committed large binary files, which is worth a conversation - not just a bigger disk.

This guide is based on the Technical Anshu GitLab server video • Stuck on any step? Ask in the video comments — you will get a reply there 🙏