Files
Wolfgang Hottgenroth b2249c06e9
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
mdwiki test starts
2025-04-14 22:22:45 +02:00

178 lines
11 KiB
HTML

<!DOCTYPE html>
<html lang="en-us">
<head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script><meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Gitlab Backup and Restore - Minimal Setups</title>
<meta name="generator" content="Hugo 0.140.2">
<link href="http://172.16.3.33:1313//index.xml" rel="alternate" type="application/rss+xml">
<link rel="canonical" href="http://172.16.3.33:1313/howtos/gitlab-backup/">
<link rel="stylesheet" href="http://172.16.3.33:1313/css/theme.min.css">
<link rel="stylesheet" href="http://172.16.3.33:1313/css/chroma.min.css">
<script defer src="http://172.16.3.33:1313//js/fontawesome6/all.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery.easing@1.4.1/jquery.easing.min.js" integrity="sha256-H3cjtrm/ztDeuhCN9I4yh4iN2Ybx/y1RM7rMmAesA0k=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js" integrity="sha256-4XodgW4TwIJuDtf+v6vDJ39FVxI0veC/kSCCmnFp7ck=" crossorigin="anonymous"></script>
<script src="http://172.16.3.33:1313/js/bundle.js"></script><style>
:root {}
</style>
<meta property="og:url" content="http://172.16.3.33:1313/howtos/gitlab-backup/">
<meta property="og:site_name" content="Minimal Setups">
<meta property="og:title" content="Gitlab Backup and Restore">
<meta property="og:description" content="Backup Find the backup directory:
grep backup_path /etc/gitlab/gitlab.rb Issue backup:
sudo gitlab-backup create Transfer backup using scp to destination machine.
Backup configuration and secrets:
sudp cp /etc/gitlab/gitlab-secrets.json /backuppath/ sudo cp /etc/gitlab/gitlab.rb /backuppath/ Restore See also here: https://docs.gitlab.com/ee/administration/backup_restore/restore_gitlab.html
DO NOT OVERWRITE THE CONFIGURATION ON THE DESTINATION MACHINE. COMPARE IT AND CONSIDER AND EVALUATE EACH DIFFERENCE
Stop processes of GitLab connecting to the database:
gitlab-ctl stop puma gitlab-ctl stop sidekiq # check gitlab-ctl status Do not stop the whole system since the restore tool has to connect to the database which would also stop in that case.">
<meta property="og:locale" content="en_us">
<meta property="og:type" content="article">
<meta property="article:section" content="howtos">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Gitlab Backup and Restore">
<meta name="twitter:description" content="Backup Find the backup directory:
grep backup_path /etc/gitlab/gitlab.rb Issue backup:
sudo gitlab-backup create Transfer backup using scp to destination machine.
Backup configuration and secrets:
sudp cp /etc/gitlab/gitlab-secrets.json /backuppath/ sudo cp /etc/gitlab/gitlab.rb /backuppath/ Restore See also here: https://docs.gitlab.com/ee/administration/backup_restore/restore_gitlab.html
DO NOT OVERWRITE THE CONFIGURATION ON THE DESTINATION MACHINE. COMPARE IT AND CONSIDER AND EVALUATE EACH DIFFERENCE
Stop processes of GitLab connecting to the database:
gitlab-ctl stop puma gitlab-ctl stop sidekiq # check gitlab-ctl status Do not stop the whole system since the restore tool has to connect to the database which would also stop in that case.">
<meta itemprop="name" content="Gitlab Backup and Restore">
<meta itemprop="description" content="Backup Find the backup directory:
grep backup_path /etc/gitlab/gitlab.rb Issue backup:
sudo gitlab-backup create Transfer backup using scp to destination machine.
Backup configuration and secrets:
sudp cp /etc/gitlab/gitlab-secrets.json /backuppath/ sudo cp /etc/gitlab/gitlab.rb /backuppath/ Restore See also here: https://docs.gitlab.com/ee/administration/backup_restore/restore_gitlab.html
DO NOT OVERWRITE THE CONFIGURATION ON THE DESTINATION MACHINE. COMPARE IT AND CONSIDER AND EVALUATE EACH DIFFERENCE
Stop processes of GitLab connecting to the database:
gitlab-ctl stop puma gitlab-ctl stop sidekiq # check gitlab-ctl status Do not stop the whole system since the restore tool has to connect to the database which would also stop in that case.">
<meta itemprop="wordCount" content="153"><script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>
</head>
<body>
<div class="container"><header>
<h1>Minimal Setups</h1>
</header>
<div class="global-menu">
<nav>
<ul>
<li class=""><a href="/keys/">Keys</a></li>
<li class=""><a href="/about/">About</a></li></ul>
</nav>
</div>
<div class="content-container">
<main><h1>Gitlab Backup and Restore</h1>
<h2 id="backup">Backup</h2>
<p>Find the backup directory:</p>
<pre tabindex="0"><code>grep backup_path /etc/gitlab/gitlab.rb
</code></pre><p>Issue backup:</p>
<pre tabindex="0"><code>sudo gitlab-backup create
</code></pre><p>Transfer backup using scp to destination machine.</p>
<p>Backup configuration and secrets:</p>
<pre tabindex="0"><code>sudp cp /etc/gitlab/gitlab-secrets.json /backuppath/
sudo cp /etc/gitlab/gitlab.rb /backuppath/
</code></pre><h2 id="restore">Restore</h2>
<p>See also here: <a href="https://docs.gitlab.com/ee/administration/backup_restore/restore_gitlab.html">https://docs.gitlab.com/ee/administration/backup_restore/restore_gitlab.html</a></p>
<p><em>DO NOT OVERWRITE THE CONFIGURATION ON THE DESTINATION MACHINE. COMPARE IT AND CONSIDER AND EVALUATE EACH DIFFERENCE</em></p>
<p>Stop processes of GitLab connecting to the database:</p>
<pre tabindex="0"><code>gitlab-ctl stop puma
gitlab-ctl stop sidekiq
# check
gitlab-ctl status
</code></pre><p>Do not stop the whole system since the restore tool has to connect to the database which would also stop in that case.</p>
<p>Issue restore. Run this command in a screen session. It is running quite long and requires manual intervention in between.</p>
<pre tabindex="0"><code>sudo gitlab-backup restore BACKUP=...
</code></pre><p>Use the datecode and the version tag of the backup created above.</p>
<p>Remember secrets and configuration. Do not overwrite configuration, see above.</p>
<p>Reconfigure the instance:</p>
<pre tabindex="0"><code>sudo gitlab-ctl reconfigure
</code></pre><p>Start the instance:</p>
<pre tabindex="0"><code>sudo gitlab-ctl start
</code></pre><div class="edit-meta">
</div>
<nav class="pagination"><a class="nav nav-prev" href="http://172.16.3.33:1313/howtos/occ-in-nextcloud-pod/" title="Execute occ in Nextcloud pod"><i class="fas fa-arrow-left" aria-hidden="true"></i>&nbsp;Prev - Execute occ in Nextcloud pod</a>
<a class="nav nav-next" href="http://172.16.3.33:1313/howtos/gitlab-change-baseurl/" title="Gitlab Change BaseURL in Database">Next - Gitlab Change BaseURL in Database <i class="fas fa-arrow-right" aria-hidden="true"></i></a>
</nav><footer>
</footer>
</main>
<div class="sidebar">
<nav class="slide-menu">
<ul>
<li class=""><a href="http://172.16.3.33:1313/">Home</a></li>
<li class=" has-sub-menu"><a href="http://172.16.3.33:1313/blog/">Blogs<span class="mark closed">+</span></a>
<ul class="sub-menu">
<li class=""><a href="http://172.16.3.33:1313/blog/tetris/">2024-05-27<br/> Tetris </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/rgb-driver/">2024-05-25<br/> PL 9823 meets MSP430 </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/timeserver2/">2025-03-13<br/> Stratum 1 NTP Server participating in ntppool.org </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/timeserver/">2025-02-11<br/> Just another Stratum 1 Timeserver </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/debouncing/">2018-04-30<br/> Yet Another Debouncing Method </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/three-phase-inverter-ng/">2016-12-19<br/> Three Phase Inverter - Second Service </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/three-phase-inverter/">2016-10-14<br/> Three Phase Inverter </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/theremin/">2013-07-01<br/> Theremin </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/email-childprot/">2013-06-27<br/> Children Protection for Postfix-based EMail-Server </a></li>
</ul>
</li>
<li class=" has-sub-menu"><a href="http://172.16.3.33:1313/articles/">Articles<span class="mark closed">+</span></a>
<ul class="sub-menu">
<li class=""><a href="http://172.16.3.33:1313/articles/quotes/"> Quotes </a></li>
</ul>
</li>
<li class="parent has-sub-menu"><a href="http://172.16.3.33:1313/howtos/">HowTos<span class="mark opened">-</span></a>
<ul class="sub-menu">
<li class=""><a href="http://172.16.3.33:1313/howtos/colors-in-minicom/"> Colors in Minicom </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/engel-des-herrn/"> Engel des Herrn </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/occ-in-nextcloud-pod/"> Execute occ in Nextcloud pod </a></li>
<li class="active"><a href="http://172.16.3.33:1313/howtos/gitlab-backup/"> Gitlab Backup and Restore </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/gitlab-change-baseurl/"> Gitlab Change BaseURL in Database </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/gitlab-upgrades/"> Gitlab Upgrades </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/ca-certificate-in-debian/"> How to add a CA certificate in Debian </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/iscsi-on-linux/"> iSCSI on Linux </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/magnifikat/"> Magnifikat </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/neovim/"> Neovim Setup </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/putty-and-hardware-keys/"> PuTTY and OPENGPG hardware keys </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/resize-hdd-on-running-system/"> Resize HDD on running system </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/snmpwalk-with-numeric-and-text-output/"> snmpwalk with numeric and text output of oid </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/prince-of-persia-1/"> Solution for Prince of Persia 1 </a></li>
</ul>
</li>
</ul>
</nav>
<div class="sidebar-footer"></div>
</div>
</div><a href="#" id="backtothetop-fixed" class="backtothetop"
data-backtothetop-duration="600"
data-backtothetop-easing="easeOutQuart"
data-backtothetop-fixed-fadeIn="1000"
data-backtothetop-fixed-fadeOut="1000"
data-backtothetop-fixed-bottom="10"
data-backtothetop-fixed-right="20">
<span class="fa-layers fa-fw">
<i class="fas fa-circle"></i>
<i class="fas fa-arrow-circle-up"></i>
</span></a>
</div>
</body>
</html>