Difference between revisions of "Gitlab Migration"

From Public PIC Wiki
Jump to navigation Jump to search
Line 14: Line 14:
  
 
     # Update the URL of the repository
 
     # Update the URL of the repository
     $ git remote set-url origin $(git remote show -n origin | grep "Fetch URL" | awk '{print $3}' | sed s/gitlab01.pic.es/gitlab.pic.es/g)
+
     $ 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)
 
      
 
      
 
     # Push everything to new remote
 
     # Push everything to new remote
Line 20: Line 20:
 
     $ git push origin --tags
 
     $ 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.
  
There will be a 3 month period where both gitlab host will coexist to give time users to migrate.
+
'''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.'''
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
 
    $ git remote set-url origin $(git remote -v | awk '{print $2}' | sort -u | sed s/gitlab02.pic.es/gitlab.pic.es/g)
 

Revision as of 12:20, 13 December 2018

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)
   
   # 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.