Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

GitLab – Move data to different directory

Posted on November 29, 2016 By David Kittell

If you’re running low on disk space or simply want to move the data this script will help. Of course modify the path as needed.

First double check your paths

df -h
# Backup GitLab Configuration
sudo cp /etc/gitlab/gitlab.rb /etc/gitlab/gitlab.rb.bk

# Set the data directory path
sed -i "s|# git_data_dirs({\"default\" => \"/var/opt/gitlab/git-data\"})|git_data_dirs({\"default\" => \"/mnt/data01/gitlab\"})|" /etc/gitlab/gitlab.rb

# Prevent users from writing to the repositories while you move them.
sudo gitlab-ctl stop

# Note there is _no_ slash behind 'repositories', but there _is_ a
# slash behind 'git-data'.
sudo rsync -av /var/opt/gitlab/git-data/repositories /mnt/data01/gitlab/git-data/

# Start the necessary processes and run reconfigure to fix permissions
# if necessary
sudo gitlab-ctl upgrade

# Double-check directory layout in /mnt/data01/gitlab/git-data. Expected output:
# repositories
sudo ls /mnt/data01/gitlab/git-data/

# Just in case
sudo gitlab-ctl reconfigure

# Done! Start GitLab and verify that you can browse through the repositories in
# the web interface.
sudo gitlab-ctl start
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

CentOS Code Fedora GitLab Red Hat UNIX UNIX Shell Scripts

Post navigation

Previous post
Next post

Related Posts

PowerShell – Set Execution Policy Permissions

Posted on March 22, 2016March 22, 2016

In order for PowerShell to run scripts you need to grant it specific permissions. Restricted No scripts can be run. Windows PowerShell can be used only in interactive mode. AllSigned Only scripts signed by a trusted publisher can be run. RemoteSigned Downloaded scripts must be signed by a trusted publisher…

Read More

Azure – MSSQL Server Information

Posted on May 13, 2016

Same as MSSQL Server Information but is specific to what will work in Azure — Basic Information SELECT @@Servername AS [Server Name] –,@@ServiceName AS [Service Instance] ,Name AS [Database Name] ,create_date AS [Service Started] ,DATEDIFF(s, create_date, GETDATE()) / 86400.0 AS [Days Running] ,DATEDIFF(s, create_date, GETDATE()) AS [Seconds Runnig] ,@@VERSION AS…

Read More

Responsive Design Tabled Div

Posted on October 1, 2013October 26, 2015

#page { max-width: 1280px; height: 100%; } /* Portrait Start */ @media screen and (max-width: 540px) { } /* Portrait Stop */ /* Landscape Start */ @media screen and (min-width: 541px) { #BodyContent1 { width: 50%; float: left; height:100%; } #BodyContent2 { width: 50%; float: right; height:100%; } } /*…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes