Difference between revisions of "Gitlab Migration"

From Public PIC Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The gitlab service need to be upgraded to a new version and host.
+
In order to upgrade the gitlab service, it was required to move it to a new host.
It will be migrated from gitlab01.pic.es (running v6.x) to gitlab02.pic.es (running v11.x).
+
The migration of the git repositories from the old host to the new one cannot be done transparently because the previous version has not easy upgrade procedure.
This upgrade cannot be done transparently to the users because the actual version is too old.
+
For newer releases, all information will be preserved and the procedure will be done without any user intervention.
For newer releases this will be done without any user intervention.
 
  
The upgrade of the service need to be done in two steps.
+
'''Also, note that for this particular upgrade, all information from tickets, merge requests and wiki WILL NOT BE MIGRATED.'''
First, users must migrate their repositories to the new host following these instructions:
 
  
     # Create a remote called new_gitlab with the new address of the repository
+
In order to migrate your git repositories to the new host, follow these instructions:
     $ git remote add new_gitlab $(git remote -v | awk '{print $2}' | sort -u | sed s/gitlab01.pic.es/gitlab02.pic.es/g)
+
 
 +
1) Log into https://gitlab.pic.es with your PIC credentials
 +
 
 +
2) If you use want to use SSH authentication, you have to upload the corresponding public key. You can access this from the ''Settings'' drop-down menu in the top-left of the screen.
 +
 
 +
3) For each git repository that you want to migrate, execute the the following commands onto the directory it resides:
 +
 
 +
     # Update the URL of the repository
 +
     $ git remote set-url origin $(git remote show -n origin | grep "Fetch URL" | awk '{print $3}' | sed s/gitlab0[12].pic.es/gitlab.pic.es/g)
 
      
 
      
     # Upload the repository to the new remote
+
     # Remove old gitlab01.pic.es host key
     $ git push new_gitlab --all
+
     $ ssh-keygen -R gitlab.pic.es
    $ git push new_gitlab --tags
 
 
      
 
      
     # Rename the old remote
+
     # Push everything to new remote
     $ git remote rename origin old_gitlab
+
     $ git push origin --all
      
+
     $ git push origin --tags
    # Rename the new remote
+
 
    $ git remote rename new_gitlab origin
+
The old gitlab service will still be available on read-only at gitlab01.pic.es until the end of February 2019, when it will be finally decomissioned.
 +
 
 +
'''For users of projects (i.e. CTA) that already migrated, you still need to update your remote URL (step 3) to be able to take advantage of future upgrades.'''
 +
 
 +
== Issues and Troubleshooting ==
 +
=== TCP connection reset by peer ===
 +
You may be one of the few unlucky users that see this error appearing when trying to clone or fetch from gitlab.
 +
git clone https://gitlab.pic.es/user/repository.git
 +
fatal: unable to access 'https://gitlab.pic.es/user/repository.git': TCP connection reset by peer
 +
As [https://stackoverflow.com/questions/53594412/what-version-of-git-supports-tls-1-2#answer-53594630 this note] from Stack Overflow says, the version of the git package included on Red Hat version 5, lower than 6.8 and lower than 7.2 doesn't support TLSv1.2, the one needed for SSL transfers.
 +
 
 +
Please, update your Operating System or [https://confluence.atlassian.com/crucible/installing-and-upgrading-git-679608571.html try to update] your git version.
  
There will be a 3 month period where both gitlab host will coexist to give time users to migrate.
+
=== GitLab: The project you were looking for could not be found ===
After that, gitlab01 will be decomissioned and the gitlab.pic.es alias will point to gitlab02.pic.es.
 
Users shall then update their remotes to point to the alias so that future upgrades can be done transparently.
 
  
    # Change the remote called origin with the new address of the repository
+
Group members and permissions might have not been migrated. Please send a support request to astro@pic.es.
    $ git remote set-url origin $(git remote -v | awk '{print $2}' | sort -u | sed s/gitlab02.pic.es/gitlab.pic.es/g)
 

Latest revision as of 12:07, 10 January 2019

In order to upgrade the gitlab service, it was required to move it to a new host. The migration of the git repositories from the old host to the new one cannot be done transparently because the previous version has not easy upgrade procedure. For newer releases, all information will be preserved and the procedure will be done without any user intervention.

Also, note that for this particular upgrade, all information from tickets, merge requests and wiki WILL NOT BE MIGRATED.

In order to migrate your git repositories to the new host, follow these instructions:

1) Log into https://gitlab.pic.es with your PIC credentials

2) If you use want to use SSH authentication, you have to upload the corresponding public key. You can access this from the Settings drop-down menu in the top-left of the screen.

3) For each git repository that you want to migrate, execute the the following commands onto the directory it resides:

   # Update the URL of the repository
   $ git remote set-url origin $(git remote show -n origin | grep "Fetch URL" | awk '{print $3}' | sed s/gitlab0[12].pic.es/gitlab.pic.es/g)
   
   # Remove old gitlab01.pic.es host key
   $ ssh-keygen -R gitlab.pic.es
   
   # Push everything to new remote
   $ git push origin --all
   $ git push origin --tags

The old gitlab service will still be available on read-only at gitlab01.pic.es until the end of February 2019, when it will be finally decomissioned.

For users of projects (i.e. CTA) that already migrated, you still need to update your remote URL (step 3) to be able to take advantage of future upgrades.

Issues and Troubleshooting

TCP connection reset by peer

You may be one of the few unlucky users that see this error appearing when trying to clone or fetch from gitlab.

git clone https://gitlab.pic.es/user/repository.git
fatal: unable to access 'https://gitlab.pic.es/user/repository.git': TCP connection reset by peer

As this note from Stack Overflow says, the version of the git package included on Red Hat version 5, lower than 6.8 and lower than 7.2 doesn't support TLSv1.2, the one needed for SSL transfers.

Please, update your Operating System or try to update your git version.

GitLab: The project you were looking for could not be found

Group members and permissions might have not been migrated. Please send a support request to astro@pic.es.