<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Abid Inamdar's Blog]]></title><description><![CDATA[Abid Inamdar's Blog]]></description><link>https://abidsblog.inamdar.co.in</link><generator>RSS for Node</generator><lastBuildDate>Tue, 05 May 2026 14:53:37 GMT</lastBuildDate><atom:link href="https://abidsblog.inamdar.co.in/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Gitlab Backup and Restore]]></title><description><![CDATA[How to take a backup of a working Gitlab and restore it
backup prerequisites

Make sure the version is the same in both Gitlab and the backfile generated

Backup
For GitLab 12.2 or later:
sudo gitlab-backup create
This creates a .tar file with UNIX t...]]></description><link>https://abidsblog.inamdar.co.in/gitlab-backup-and-restore</link><guid isPermaLink="true">https://abidsblog.inamdar.co.in/gitlab-backup-and-restore</guid><category><![CDATA[GitLab]]></category><dc:creator><![CDATA[Abid Inamdar]]></dc:creator><pubDate>Mon, 23 Jun 2025 16:20:19 GMT</pubDate><content:encoded><![CDATA[<p><strong>How to take a backup of a working Gitlab and restore it</strong></p>
<h2 id="heading-backup-prerequisites"><strong>backup prerequisites</strong></h2>
<ul>
<li>Make sure the version is the same in both Gitlab and the backfile generated</li>
</ul>
<h1 id="heading-backup"><strong>Backup</strong></h1>
<p>For GitLab 12.2 or later:</p>
<p><code>sudo gitlab-backup create</code></p>
<p>This creates a .tar file with UNIX time and the GitLab version filename. Now you can transfer this file for restoration. We can use SFTP, rsync, or an S3 bucket for transferring. If you have configured an IAM role to backup to S3, by running this command, it automatically uploads the backup file to S3.</p>
<h2 id="heading-restore-prerequisites"><strong>Restore prerequisites</strong></h2>
<ul>
<li>To restore a backup, you must restore <code>/etc/gitlab/gitlab-secrets.json</code> (for Omnibus packages) or <code>/home/git/gitlab/.secret</code> (for installations from source). This file contains the database encryption key, <a target="_blank" href="https://docs.gitlab.com/ee/ci/variables/index.html">CI/CD variables</a>, and variables used for <a target="_blank" href="https://docs.gitlab.com/ee/user/profile/account/two_factor_authentication.html">two-factor authentication</a>. If you fail to restore this encryption key file along with the application data backup, users with two-factor authentication enabled and GitLab Runner loses access to your GitLab server.</li>
</ul>
<p>This procedure assumes that:</p>
<ul>
<li><p>You have installed the <strong>exact same version and type (CE/EE)</strong> of GitLab Omnibus with which the backup was created.</p>
</li>
<li><p>You have run <code>sudo gitlab-ctl reconfigure</code> at least once.</p>
</li>
<li><p>GitLab is running. If not, start it using <code>sudo gitlab-ctl start</code>.</p>
</li>
</ul>
<h1 id="heading-restore"><strong>Restore</strong></h1>
<p>First ensure your backup tar file is in the backup directory described in the <code>gitlab.rb</code> configuration <code>gitlab_rails['backup_path']</code>. The default is <code>/var/opt/gitlab/backups</code>. It needs to be owned by the <code>git</code> user.</p>
<pre><code class="lang-plaintext">sudo cp 16493107454_2022_04_25_14.6.1-ee_gitlab_backup.tar /var/opt/gitlab/backups/
sudo chown git:git /var/opt/gitlab/backups/16493107454_2022_04_25_14.6.1-ee_gitlab_backup.tar
</code></pre>
<p>Stop the processes that are connected to the database. Leave the rest of GitLab running:</p>
<pre><code class="lang-plaintext">sudo gitlab-ctl stop puma
sudo gitlab-ctl stop sidekiq
# Verify
sudo gitlab-ctl status
</code></pre>
<p>Next, restore the backup, specifying the timestamp of the backup you wish to restore:</p>
<p><code># This command will overwrite the contents of your GitLab database!   sudo gitlab-backup restore BACKUP=16493107454_2022_04_25_14.6.1-ee</code></p>
<blockquote>
<p><em>If there’s a GitLab version mismatch between your backup tar file and the installed version of GitLab, the restore command aborts with an error message. Install the</em> <a target="_blank" href="https://packages.gitlab.com/gitlab/"><em>correct GitLab version</em></a><em>, and then try again.</em></p>
</blockquote>
<p>Next, restore <code>/etc/gitlab/gitlab-secrets.json</code> if necessary, <a target="_blank" href="https://docs.gitlab.com/ee/raketasks/backup_restore.html#restore-prerequisites">as previously mentioned</a>.</p>
<p>Reconfigure, restart and <a target="_blank" href="https://docs.gitlab.com/ee/administration/raketasks/maintenance.html#check-gitlab-configuration">check</a> GitLab:</p>
<pre><code class="lang-plaintext">sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
sudo gitlab-rake gitlab:check SANITIZE=true
</code></pre>
<p><strong>backup prerequisites</strong></p>
<ul>
<li>Make sure the version is the same in both Gitlab and the backfile generated</li>
</ul>
<h1 id="heading-backup-1"><strong>Backup</strong></h1>
<p>For GitLab 12.2 or later:</p>
<p><code>sudo gitlab-backup create</code></p>
<p>This creates a .tar file with UNIX time and gitlab version filename. now you can transfer this file for restoring. we can use sftp, rsync, or s3 bucket for transfering. If you have configured IAM role to backup to S3, by running this command it automatically uploads the backup file to S3.</p>
<h2 id="heading-restore-prerequisites-1"><strong>Restore prerequisites</strong></h2>
<ul>
<li>To restore a backup, you must restore <code>/etc/gitlab/gitlab-secrets.json</code> (for Omnibus packages) or <code>/home/git/gitlab/.secret</code> (for installations from source). This file contains the database encryption key, <a target="_blank" href="https://docs.gitlab.com/ee/ci/variables/index.html">CI/CD variables</a>, and variables used for <a target="_blank" href="https://docs.gitlab.com/ee/user/profile/account/two_factor_authentication.html">two-factor authentication</a>. If you fail to restore this encryption key file along with the application data backup, users with two-factor authentication enabled and GitLab Runner loses access to your GitLab server.</li>
</ul>
<p>This procedure assumes that:</p>
<ul>
<li><p>You have installed the <strong>exact same version and type (CE/EE)</strong> of GitLab Omnibus with which the backup was created.</p>
</li>
<li><p>You have run <code>sudo gitlab-ctl reconfigure</code> at least once.</p>
</li>
<li><p>GitLab is running. If not, start it using <code>sudo gitlab-ctl start</code>.</p>
</li>
</ul>
<h1 id="heading-restore-1"><strong>Restore</strong></h1>
<p>First, ensure your backup tar file is in the backup directory described in the <code>gitlab.rb</code> configuration <code>gitlab_rails['backup_path']</code>. The default is <code>/var/opt/gitlab/backups</code>. It needs to be owned by the <code>git</code> user.</p>
<pre><code class="lang-plaintext">sudo cp 16493107454_2022_04_25_14.6.1-ee_gitlab_backup.tar /var/opt/gitlab/backups/
sudo chown git:git /var/opt/gitlab/backups/16493107454_2022_04_25_14.6.1-ee_gitlab_backup.tar
</code></pre>
<p>Stop the processes that are connected to the database. Leave the rest of GitLab running:</p>
<pre><code class="lang-plaintext">sudo gitlab-ctl stop puma
sudo gitlab-ctl stop sidekiq
# Verify
sudo gitlab-ctl status
</code></pre>
<p>Next, restore the backup, specifying the timestamp of the backup you wish to restore:</p>
<p><code># This command will overwrite the contents of your GitLab database!   sudo gitlab-backup restore BACKUP=16493107454_2022_04_25_14.6.1-ee</code></p>
<blockquote>
<p><em>If there’s a GitLab version mismatch between your backup tar file and the installed version of GitLab, the restore command aborts with an error message. Install the</em> <a target="_blank" href="https://packages.gitlab.com/gitlab/"><em>correct GitLab version</em></a><em>, and then try again.</em></p>
</blockquote>
<p>Next, restore <code>/etc/gitlab/gitlab-secrets.json</code> if necessary, <a target="_blank" href="https://docs.gitlab.com/ee/raketasks/backup_restore.html#restore-prerequisites">as previously mentioned</a>.</p>
<p>Reconfigure, restart and <a target="_blank" href="https://docs.gitlab.com/ee/administration/raketasks/maintenance.html#check-gitlab-configuration">check</a> GitLab:</p>
<pre><code class="lang-plaintext">sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
sudo gitlab-rake gitlab:check SANITIZE=true
</code></pre>
]]></content:encoded></item><item><title><![CDATA[My First]]></title><description><![CDATA[With the use of C#, we can develop a console application that uses the Chat GPT model to generate human-like responses to input.
In this blog post, we will explore the steps to develop a console application using OpenAI's Chat GPT model using C#.
Ope...]]></description><link>https://abidsblog.inamdar.co.in/my-first</link><guid isPermaLink="true">https://abidsblog.inamdar.co.in/my-first</guid><dc:creator><![CDATA[Abid Inamdar]]></dc:creator><pubDate>Tue, 31 Dec 2024 12:11:45 GMT</pubDate><content:encoded><![CDATA[<p>With the use of <strong>C#</strong>, we can develop a console application that uses the <strong>Chat GPT</strong> model to generate human-like responses to input.</p>
<p>In this blog post, we will explore the steps to develop a console application using <strong>OpenAI's Chat GPT</strong> model using C#.</p>
<p><em>OpenAI</em> is a leading organization in the field of artificial intelligence, and one of its popular AI models is the Chat GPT (Generative Pretrained Transformer)./</p>
]]></content:encoded></item></channel></rss>