Move GitLab folders to a bigger size disk

Hello!

We’ve just set up GitLab 15.8.0 on Ubuntu 22.04. GitLab was set up on system drive with not much space. Now we’ve add a new big drive. I want to move all folders to the new drive. What should I consider to move? In other words I want to keep only GitLab runtime on the system drive and move all the data stuff to the big drive. What comes to my mind are:

  • PostgreSQL database
  • Folders where GitLab stores git repos

What else ?

Generally, unless the defaults have been changed, everything is under /var/opt/gitlab for the database, container registry, repositories, etc, etc.

I would move the contents of /var/opt/gitlab to the new disk, and then mount the new disk to /var/opt/gitlab once that directory is empty. If you move the gitlab directory itself, then you would need to mount your new disk to /var/opt.

The runtime binaries are in /opt/gitlab so you can leave that pretty much where it is.

Whichever commands you use to move it, ensure the permissions are intact. Using mv should do that for you, other commands such as cp or rsync would require additional parameters to ensure permissions are preserved.

2 Likes