Gitlab upgrade but gitlab.rb unchange - gitlab

I am using GitLab CE. I upgrade GitLab CE from 7.14.3 to 8.9.6 through apt-get upgrade. After successfully upgrade, I found that the gitlab configuration file which locates in /etc/gitlab/gitlab.rb keeps the same.
But why? I thought that GitLab upgrade would automatically update the new features to gitlab.rb. For now, I have to copy the newest configuration file and find the difference and then merge it to my current gitlab.rb.
Is there any way to auto upgrade configuration file to the newest and merge the configuration which I had changed?

You can easily check the diff with gitlab-ctl diff-config.
Then change what's new so the diff is minimal or if you have no changed done to gitlab.rb you can just copy /opt/gitlab/etc/gitlab.rb.template over it.

Related

What is var/plugins.json and should it go into version control (Shopware 6.3.5.2)?

On a quite fresh setup I ran
bin/build-storefront.sh
Now var/plugins.json is on the list of changed files in git. Now I am wondering if I should commit this file, because it contains local absolute paths - which might be different on other systems:
EDIT: The file seems to be recreated during build, when I deleted it. However it's in the production-template git repository which is strange.
var/plugins.json is auto generated by build-administration.sh and build-storefront.sh to set entry points and output files for Webpack for the installed plugins.
This file should not be commited. If you commit, it will be replaced anyway. It will be ignored by git in the upcoming version of Shopware 6.4 (see the commit).

Copy Gitlab repositories to another Gitlab server through filesystem

I had a gitlab server of 7.6.2 version with some repositories. Now this server was upgraded by newest Ubuntu and it has an empty gitlab server of version 12.0.1. I also have a HDD backup from old gitlab server.
I need to move all repositories from old gitlab server to the new one. I tried to copy .git repositories from /var/opt/gitlab/repositories/user/ to the similar location of the new server with disabled hashed repositories storage, but it has no effect.
I also tried to create an empty repository with e.g. name test and replace test.git directory on new server from directory from old one, but there is no effect neither.
I tried to find file from created test repository named test.txt by find command in whole server file system, but there is no such file was found (but this file exists in the gitlab repository).
My question is: where repositories of gitlab server are stored and how can I copy it from backup of old server HDD to the new server file system (I can not run both instances of gitlab because I have only one machine. Running backup of old server as virtual machine's rootfs is also impossible by some reasons).
Upd.
It is not duplicate of this question because I have no backups of old gitlab server made by gitlab, I have only backup of filesystem of machine it was installed on. I also can not run old server to pull repositories because its machine was upgraded. Only thing I have from old server: its filesystem.
If you just need to migrate repositories (ie: no issues, pipelines, etc), it's better to clone each repository and upload it again (one by one, or using a batch command):
cd /var/opt/gitlab/repositories/...
git remote add newserver url
git push --all newserver url
Instead, if you need to migrate all features, it's better to restore the server backup and upgrade OS and Gitlab in place... even if it's a long road between 7 and 12, and you probably neeed to make multiple steps.
Careful, this might cause massive breakage, experiment on a scratch system.
The git repositories should be the same, so I'd try just copying the contents over. The user information and ancillary stuff is probably different.
Another path would be to set up the old system, and upgrade that one. Version by version, if need be.
Last resort is to clone the old repositories and upload them into the new system.

How to configure the unicorn workers in gitlab-bitnami?

I install gitlab but with bitnami installation...and I need to change the unicorn workers to accelerate the server...but i can't find the configure file to change this parameter (worker_processes)....
Since 8.16.3 version, Bitnami started to install GitLab using omnibus so if you have this version or a newer one you can follow the official gitlab documentation:
https://docs.gitlab.com/omnibus/settings/unicorn.html
If you are using gitlab 8.14.3 or lower, you are still using the gitlab installation from source code. In that case, unicorn is not used but mod_passenger plus apache. If you are using this configuration, please take a look at the optimization options for mod_passenger.
https://www.phusionpassenger.com/library/config/apache/optimization/
You could update the /opt/bitnami/apps/gitlab/conf/httpd-app.conf file and then restart the apache server for the changes to take effect.

Trying to make Host sFlow for XenServer 7.0

I spent all day trying to make Host sFlow 2.0.6-1 from sources (https://github.com/sflow/host-sflow/releases) for XenServer 7.0 using the XenServer DDK from this site: http://xenserver.org/overview-xenserver-open-source-virtualization/download.html
First I had to make 2 changes to the file hsflowd-xen.spec:
Changed line 3 to: "Version: 2.0.6" (it was still 2.0.1)
Changed line 20 to: "%setup -n hsflowd-2.0.6-1" (added the name because the default one was wrong).
Now my problem is that I dont have the xenstore.h file. After long searches I found that it's in the package libxen-dev (or libxen-devel) but I couldn't find it with its dependecies anywhere.
The four most probable solutions I think are :
1. (The lazy one) Get the iso file for Host sFlow already built for XenServer 7.0 (the official site stopped building at 6.5)
Set up a proper yum repository that will contain libxen-dev and its dependencies. I can't even connect to the official CentOS repositories because the files in /etc/yum.repos.d/ have a bad URL.
This is the content of /etc/centos-release: "XenServer DDK release 7.0.0-125770c (xenenterprise)"
Somehow manage to use 'xenstore.a' instead of 'xenstore.h'. I changed the code in src/Linux/mod_xen.c to include 'xenstore.a' instead of 'xenstore.h' but when I build it, it creates a new file with the old code and ignores my changes. I probably changed the wrong files because there are different copies of the whole code. I'm not even sure it would work though even if I did manage to include 'xenstore.a'.
Make xenstore from sources. I didn't try it because I only found old sources and I figured I'd miss the dependencies too.
PS: I'm n00b at CentOS and Makefiles in general so the solution might be obvious and I just don't know it.
With gratitude to lagange, I updated the host-sflow project with a XenServer 7 build. I also added a Docker recipe so you can replace all these steps with just "./docker_build_on xenserver". Please raise issues on https://github.com/sflow/host-sflow.
I finally succeeded in building it. That's what I had to do step by step:
Import the XenServer DDK 7.0.0 into XenCenter.
Extend xvda1 following these steps: https://support.citrix.com/article/CTX125405
Make these changes to hsflowd-xen.spec:
3rd line: Version: 2.0.6
20th line: %setup -n hsflowd-2.0.6-1
Add these two lines before %description:
%define debug_package %{nil}
%define _unpackaged_files_terminate_build 0
Change file /etc/yum.repos.d/CentOS-Base
Change all occurrences of "$releasever" to "7".
Change all occurrences of "$basearch" to "x86_64".
Change "enabled=0" to "enabled=1" for each repository.
Uncomment baseurl lines for each repository.
Mount the Development packages (binpkg.iso available on the xenserver.org download page) and add a file for it in /etc/yum.repos.d/
Mine looks like it:
[binpkg]
name=CitrixXenServer7
enabled=1
baseurl=file:///mnt/binpkg/
gpgcheck=0
Install the two following packages with Yum (dependencies should install correctly now):
xen-libs-devel.x86_64
xen-dom0-libs-devel.x86_64
Make the file and install it using this tutorial: https://raw.githubusercontent.com/sflow/host-sflow/v2.0.4/INSTALL.XenServer

Gitlab: how to change domain on the old uploaded assets?

I have changed the domain on my gitlab installation from ABC to XYZ according to the procedure explained here:
How to change URL of a working GitLab install?
The problem is, that old uploaded assets (images that were added to issues in projects), still point to the old ABC domain:
https://ABC/uploads/...
The Site is using SSL. The old ABC SSL certificate is no longer valid. Hence, those assets generate "net::ERR_INSECURE_RESPONSE" in the browser and are not shown.
Is there a way to update those assets to use the new domain name? I have tried:
bundle exec rake assets:precompile RAILS_ENV=production
to no avail.
Newly uploaded images on the new domain show correctly.
Gitlab: how to change domain on the old uploaded assets?
For what I could understand, older versions of Gitlab store the absolute path of the attached files in the issue description. So even if you reconfigure Gitlab, the URLs in the issue descriptions will still be pointing to the old domain.
After you reconfigure your Gitlab with the new domain you could:
1: edit the posts manually
If you don't have a lot of embeded files you can just edit every issue and save. Any edit will trigger the link update.
2: edit the database
sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql/ gitlabhq_production
update issues set description_html = replace(description_html, 'old.domain', 'new.domain');
3: update Gitlab then clear the cache
Newer versions of Gitlab store a relative path to the uploaded files instead of the absolute one
apt-get install gitlab
sudo gitlab-rake cache:clear
sudo gitlab-ctl reconfigure
References
https://gitlab.com/gitlab-org/gitlab-ce/issues/32789
https://gitlab.com/gitlab-org/gitlab-ce/issues/2476
How to change URL of a working GitLab install?
direct access to to gitlab database

Resources