• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to restore Gitlab backup on Ubuntu 21.04

  • 00:37 gitlab-rake gitlab:env:info
  • 01:17 gitlab-rake gitlab:env:info
  • 02:57 gitlab-ctl stop unicorn
  • 03:18 gitlab-ctl stop sidekiq
  • 03:42 gitlab-ctl stop puma
  • 04:10 gitlab-ctl status
  • 04:40 ls /var/opt/gitlab/backups/
  • 05:00 gitlab-rake gitlab:backup:restore BACKUP = 1637341145_2021_11_19_14.4.0
  • 06:00 gitlab-ctl reconfigure
  • 06:19 gitlab-ctl restart
6763

To restore Gitlab backup on Ubuntu 21.04

Introduction:

GitLab is a web-based repository for managing Git repositories. GitLab provides the ability to back up and restore GitLab instances through Rake tasks. This is an application data backup that creates an archive file containing the database, all repositories, and all attachments.

Step 1: Check the OS version and Gitlab installed version by using the following command

root@linuxhelp:~# gitlab-rake gitlab:env:info
System information
System:		Ubuntu 21.04
Current User:	git
Using RVM:	no
Ruby Version:	2.7.4p191
Gem Version:	3.1.4
Bundler Version:2.1.4
Rake Version:	13.0.6
Redis Version:	6.0.14
Git Version:	2.33.0.
Sidekiq Version:6.2.2
Go Version:	unknown

GitLab information
Version:	14.4.0
Revision:	51b27ab5805
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	12.7
URL:		http://gitlab.example.com
HTTP Clone URL:	http://gitlab.example.com/some-group/some-project.git
SSH Clone URL:	git@gitlab.example.com:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: 


Step 2: Take Gitlab Backup to the default backup location

root@linuxhelp:~# gitlab-rake gitlab:backup:create
2021-11-19 22:28:58 +0530 -- Dumping database ... 
Dumping PostgreSQL database gitlabhq_production ... [DONE]
2021-11-19 22:29:04 +0530 -- done
2021-11-19 22:29:04 +0530 -- Dumping repositories ...
time="2021-11-19T16:59:04.711Z" level=info msg="started create" command=create gl_project_path=root/test relative_path=@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.git storage_name=default
time="2021-11-19T16:59:04.712Z" level=info msg="started create" command=create gl_project_path=root/test.wiki relative_path=@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.wiki.git storage_name=default
time="2021-11-19T16:59:04.860Z" level=warning msg="skipped create" command=create error="manager: repository empty: repository skipped" gl_project_path=root/test.wiki relative_path=@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.wiki.git storage_name=default
time="2021-11-19T16:59:04.860Z" level=info msg="started create" command=create gl_project_path=root/test relative_path=@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.design.git storage_name=default
time="2021-11-19T16:59:04.863Z" level=warning msg="skipped create" command=create error="manager: repository empty: repository skipped" gl_project_path=root/test relative_path=@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.design.git storage_name=default

Step 3: Log in to Gitlab as an Administrator Snap 1

Step 4: Total Present projects in Gitlab Snap 2

Step 5: Delete the all 3 present projects Snap 3

Step 6: Stop the unicorn service before Restoring Backup

root@linuxhelp:~# gitlab-ctl stop unicorn

Step 7: Stop the sidekiq service before Restoring Backup

root@linuxhelp:~# gitlab-ctl stop sidekiq
ok: down: sidekiq: 0s, normally up

Step 8: Stop the puma service before Restoring Backup

root@linuxhelp:~# gitlab-ctl stop puma
ok: down: puma: 0s, normally up

Step 9: Check the status of the gitlab by using the following command

root@linuxhelp:~#  gitlab-ctl status

Step 10: List the backed up file

root@linuxhelp:~# ls /var/opt/gitlab/backups/
1637341145_2021_11_19_14.4.0_gitlab_backup.tar

Step 11: Restore the Gitlab backup by using the following command

root@linuxhelp:~#  gitlab-rake gitlab:backup:restore BACKUP = 1637341145_2021_11_19_14.4.0

Step 12: Restart all Gitlab components by using the following command

root@linuxhelp:~# gitlab-ctl reconfigure

   * link[/opt/gitlab/service/grafana] action create (up to date)
    * ruby_block[wait for grafana service socket] action run (skipped due to not_if)
     (up to date)
Recipe: gitlab::database_reindexing_disable
  * crond_job[database-reindexing] action delete
    * file[/var/opt/gitlab/crond/database-reindexing] action delete (up to date)
     (up to date)

Running handlers:
Running handlers complete
Chef Infra Client finished, 1/766 resources updated in 20 seconds

Warnings:
Environment variable LANG specifies a non-UTF-8 locale. GitLab requires UTF-8 encoding to function properly. Please check your locale settings.

gitlab Reconfigured!

Step 13: Restart all Gitlab service by using the following command

root@linuxhelp:~# gitlab-ctl restart
ok: run: alertmanager: (pid 71291) 0s
ok: run: gitaly: (pid 71299) 0s
ok: run: gitlab-exporter: (pid 71313) 0s
ok: run: gitlab-workhorse: (pid 71316) 1s
ok: run: grafana: (pid 71325) 0s
ok: run: logrotate: (pid 71334) 0s
ok: run: nginx: (pid 71342) 1s
ok: run: node-exporter: (pid 71348) 0s
ok: run: postgres-exporter: (pid 71353) 1s
ok: run: postgresql: (pid 71361) 0s
ok: run: prometheus: (pid 71370) 0s
ok: run: puma: (pid 71378) 0s
ok: run: redis: (pid 71383) 0s
ok: run: redis-exporter: (pid 71391) 0s
ok: run: sidekiq: (pid 71397) 1s

Step 14: Again Log in to Gitlab as an Administrator Snap 4

Step 15: Retrieve all 3 projects deleted projects by restoring backup Snap 5

By this restoring Gitlab backup on Ubuntu 21.04 comes to an end.

Tags:
isaac
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

Why Gitlab provides rake tasks?

A

For common administration and operation, GitLab provides Rake tasks to perform various tasks.

Q

What is a Backup timestamp?

A

Timestamp in Gitlab backup is used to identify when the backup was created and version of GitLab.

Q

What is the default backup location of Gitlab?

A

The default backup location of Gitlab /var/opt/gitlab/backups.

Q

What is GitLab Sidekiq?

A

Sidekiq is the background job processor GitLab.

Q

What is puma in Gitlab?

A

Puma is a simple, fast, multi-threaded HTTP 1.1 server for Ruby applications.

Related Tutorials in How to restore Gitlab backup on Ubuntu 21.04

Related Tutorials in How to restore Gitlab backup on Ubuntu 21.04

How to install Meld tool in Ubuntu
How to install Meld tool in Ubuntu
Feb 25, 2017
How to add local folder to a GitLab project
How to add local folder to a GitLab project
Apr 20, 2017
How to install Dconf-Editor on Ubuntu 18.04
How to install Dconf-Editor on Ubuntu 18.04
Jul 14, 2018
How to install and update OpenSSL on Ubuntu 16.04
How to install and update OpenSSL on Ubuntu 16.04
Mar 9, 2017
How to install GLib 2.0 on Ubuntu 17.04
How to install GLib 2.0 on Ubuntu 17.04
May 22, 2017
How to Install Android Emulator on Ubuntu 20.4.1
How to Install Android Emulator on Ubuntu 20.4.1
Jul 13, 2021
How To Install AnyDesk on Ubuntu 16.04
How To Install AnyDesk on Ubuntu 16.04
Apr 4, 2018
How to install Genymotion 2.12.1 on Ubuntu 18.04
How to install Genymotion 2.12.1 on Ubuntu 18.04
Jul 9, 2018

Related Forums in How to restore Gitlab backup on Ubuntu 21.04

Related Forums in How to restore Gitlab backup on Ubuntu 21.04

Ubuntu
matthew class=
Failed to enable unit: Refusing to operate on linked unit file sshd.service
Apr 15, 2019
Ubuntu
mason class=
Passwd: You may not view or modify password information for root On Ubuntu 19.04
May 27, 2019
Ubuntu
isaac class=
/etc/apt/sources.list Permission denied
May 18, 2017
Ubuntu
yousuf class=
lsb_release command not working : Debian
Jan 18, 2018
ifconfig command
jackbrookes class=
what is the location of the ifconfig program on your machine?
Jan 4, 2018
gitlab
baseer class=
How to check gitlab version
Oct 24, 2017
Git
vertonskjelvic class=
error: failed to push some refs to in gitlab
Nov 24, 2017
Ubuntu
mason class=
"E: Package 'php-mcrypt' has no installation candidate" error on Ubuntu 20.4.1
Mar 15, 2021

Related News in How to restore Gitlab backup on Ubuntu 21.04

Related News in How to restore Gitlab backup on Ubuntu 21.04

How To Install Mixxx on Ubuntu 16.04
How To Install Mixxx on Ubuntu 16.04
Oct 11, 2017
Ubuntu 17.04 released with greater expectations
Ubuntu 17.04 released with greater expectations
Apr 15, 2017
Ubuntu Core now available on i.MX6 based TS-4900 thanks to Technologic Systems Inc.
Ubuntu Core now available on i.MX6 based TS-4900 thanks to Technologic Systems Inc.
Mar 1, 2017
Gitlab assures its users of data recovery post data loss incident
Gitlab assures its users of data recovery post data loss incident
Feb 4, 2017
Ubuntu 17.10 Artful Aardvark Beta 1 is now here. Download Now
Ubuntu 17.10 Artful Aardvark Beta 1 is now here. Download Now
Sep 2, 2017
Ubuntu Unity is no more: One Linux dream has been axed
Ubuntu Unity is no more: One Linux dream has been axed
Apr 7, 2017
What’s next for Ubuntu Linux Desktop?
What’s next for Ubuntu Linux Desktop?
Apr 11, 2017
Say Hi to Ubuntu's new mascot
Say Hi to Ubuntu's new mascot
Mar 22, 2019
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Lucas ?
Various options in Top command

Am using Top command only to view the load average, what are the various options in Top command..??

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.