Posts

Showing posts with the label gitlab-ce

Fix postgres upgrade error when upgrade Gitlab-CE from 8.x to 9.0

Image
Right after Gitlab 9.0 was released, I upgraded our gitlab 8.x server and got stucked at PostGres upgrade with the following error: ... Creating temporary data directory:Error creating new directory: /var/opt/gitlab/postgresql/data.9.6.1 ... I'd tried many things including changing the folder ownership and using a different tmp folder for postgres upgrade but it's still the same. Luckily, by searching through the Gitlab community edition issues site, I found out someone had a similar problem. I tried what they suggested and it worked. Here are the steps I had done to fix the upgrade: 1. Change the gitlab-psql users shell to /bin/bash (as root): chsh -s /bin/bash gitlab-psql 2. Run dpkg-reconfigure dash and select  NO will link /bin/sh to /bin/bash 3. Run the Gitlab upgrade again and everything was fine: gitlab-ctl upgrade Reference:   https://gitlab.com/gitlab-org/gitlab-ce/issues/29907

Run php7-fpm app with gitlab-ce's bundled nginx

If you install gitlab-ce in your Ubuntu 16.04 with the default configuration, your server will be set up to use the embedded version of nginx. If that's the case and you want to user nginx for other applications (e.g. php7-fpm) on the same server you can do either following ways: 1. Reconfigure gitlab to use external nginx (non-bundled): check here . 2. Add a new server block for the new application to the gitlab's bundled nginx I chose (2) to run my php web app. Here are the steps: 1. Create a server block configuration in gitlab's nginx directory: /var/opt/gitlab/nginx/conf/myapp.conf server {     listen 80;     root /var/www/myapp;     index index.php index.html index.htm;     server_name myapp.com;     error_log    /var/log/nginx/myapp_err.log;     location / {         try_files $uri $uri/ =404;     }     location ~ \.php$ {       ...

Migrate from manual-installed gitlab 7.8.1 to omnibus gitlab-ce 8.14.0

As you may already know, you can only restore your backups in the same gitlab version. So it means that you cannot move your old repositories to the newer version of gitlab using the backup/restore method. Fortunately there is another way to import those repositories into gitlab. Follow these instructions: In my case, I want to migrate my old repositories from a manual-installed gitlab v7.8.1 to omnibus gitlab-ce 8.14.0 instance which were installed on the same server. 1. Create a group folder in the gitlab-ce's repositories directory: sudo -u git mkdir /var/opt/gitlab/git-data/repositories/geniuses 2. Copy the old repositories (repositories in gitlab are bare ones): sudo cp -r /home/git/repositories/* /var/opt/gitlab/git-data/repositories/geniuses/ 3. Correct the permissions of the new folder and all of its sub-directories: sudo chown -R git:git /var/opt/gitlab/git-data/repositories/geniuses/ 4. Import the new copied repositories: sudo gitlab-rake gitlab:import:r...