{"id":6521,"date":"2021-08-31T15:16:08","date_gmt":"2021-08-31T09:46:08","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=6521"},"modified":"2021-08-31T15:16:14","modified_gmt":"2021-08-31T09:46:14","slug":"how-to-set-up-gitlab-backups-within-amazon-s3-bucket","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-set-up-gitlab-backups-within-amazon-s3-bucket\/","title":{"rendered":"How to set up Gitlab Backups within Amazon S3 Bucket"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">How to set up Gitlab Backups within Amazon S3 Bucket<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">Date: 30-08-2021<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1:<\/strong> Log in to the GitLab server via SSH as root.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2:<\/strong> Use the following command to create the backup if you\u2019ve installed GitLab with the Omnibus package.<br><strong><code># gitlab-rake gitlab:backup:create<\/code><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 3:<\/strong> This backup creates an archive file that contains the database, all repositories, and all attachments. The backup filename will be [TIMESTAMP]_gitlab_backup.tar in the location of<strong>&#8220;<code>\/var\/opt\/gitlab\/backups\/<\/code>&#8220;<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.51.03-PM.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"161\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.51.03-PM-1024x161.png\" alt=\"\" class=\"wp-image-6522\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.51.03-PM-1024x161.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.51.03-PM-300x47.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.51.03-PM-768x121.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.51.03-PM-850x134.png 850w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.51.03-PM.png 1336w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 4:<\/strong> You should have already created AWS s3 bucket name, IAM user access_key_id, and secret_access_key and add the below details in \/etc\/gitlab\/gitlab.rb file for omnibus packages.<br><strong><code>backup_keep_time,provider, region, aws_<meta charset=\"utf-8\">access_key_id, aws_<meta charset=\"utf-8\">secret_access_key and backup_upload-remote_directory<\/code><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.53.55-PM.png\"><img decoding=\"async\" width=\"1024\" height=\"643\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.53.55-PM-1024x643.png\" alt=\"\" class=\"wp-image-6523\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.53.55-PM-1024x643.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.53.55-PM-300x188.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.53.55-PM-768x482.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.53.55-PM-400x250.png 400w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.53.55-PM-478x300.png 478w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-30-at-5.53.55-PM.png 1360w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 5:<\/strong> Run the following command to reconfigure your GitLab after making these changes.<br><strong><code># gitlab-ctl reconfigure<\/code><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.31.52-PM.png\"><img decoding=\"async\" width=\"998\" height=\"1002\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.31.52-PM.png\" alt=\"\" class=\"wp-image-6524\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.31.52-PM.png 998w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.31.52-PM-300x300.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.31.52-PM-150x150.png 150w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.31.52-PM-768x771.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.31.52-PM-299x300.png 299w\" sizes=\"(max-width: 998px) 100vw, 998px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Step 6: Run the below command <meta charset=\"utf-8\">to create the backup.<br><meta charset=\"utf-8\"><strong><code># gitlab-rake gitlab:backup:create<\/code><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.49.17-PM-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"836\" height=\"1024\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.49.17-PM-1-836x1024.png\" alt=\"\" class=\"wp-image-6527\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.49.17-PM-1-836x1024.png 836w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.49.17-PM-1-245x300.png 245w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.49.17-PM-1-768x941.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-31-at-2.49.17-PM-1.png 1004w\" sizes=\"(max-width: 836px) 100vw, 836px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 7: <\/strong>You can set up a cron job to create GitLab back up at 2.00am every day.<br><strong><code># crontab -e<\/code><\/strong><br>Add like below.<br><strong><code>0 2 * * * \/usr\/bin\/gitlab-rake &nbsp; gitlab:backup:create<\/code><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to set up Gitlab Backups within Amazon S3 Bucket Date: 30-08-2021 Step 1: Log in to the GitLab server [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1020],"tags":[182,397,911,912],"class_list":["post-6521","post","type-post","status-publish","format-standard","hentry","category-containers-kubernetes","tag-backup","tag-gitlab","tag-gitlab-backup","tag-gitlab-backup-with-aws-s3","psol-cat-containers-kubernetes"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1Hb","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6521"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6521\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}