Search code examples
mysqlpostgresqlgitlab-omnibusgitlab-ce

How to move from gitalb source base to gitlab omnibus?


I am trying to move gitlab-ce 8.5 source base to gitlab-ce 8.15 omnibus. We were using MySQL in source base but now we have to use thepsql with gitlab-ce omnibus`. When I was trying to take a backup so it was failing due to some empty repo.

Question: Is it any alternative way to move source base to omnibus with full backup?


Solution

  • I have moved gitlab from source base to the omnibus. You can use below link to convert db dump from MySQL to psql.

    https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/mysql_to_postgresql.md

    I have created a zip file of repos manually & copied to the gitlab omnibus server & restore it on /var/opt/gitlab/git-data/repository/.

    After these steps, copy the below script on /var/opt/gitlab/git-data/xyz.sh & executed for updating the hooks.

    #!/bin/bash
    for i in repositories/* ; do
      if [ -d "$i" ]; then
        for o in $i/* ; do
         if [ -d "$i" ]; then
           rm "$o/hooks"
           # change the paths if required
           ln -s  "/opt/gitlab/embedded/service/gitlab-shell/hooks" /var/opt/gitlab/git-data/"$o"/hooks 
           echo "HOOKS CHANGED ($i/$o)"
         fi
        done
      fi
    done
    

    Note: Repos permission should be git:git

    Some useful commands during the migration:

    sudo gitlab-ctl start postgres **to start the Postgres service only**
    
    sudo gitlab-psql **to use the gitlab bundle postgres.**
    

    Feel free to comment if you face 5xx errors code on gitlab page.