I will be moving Git repositories from an older SCM server to a new one. My main concern (other than fidelity, of course) is to minimize downtime. Here is my plan:
- On the new machine, clone each repository using
git clone --mirror - Copy over repo hooks for each repository
- Disallow access to old server (we use gitosis, so remove access for all users except for the new server)
- Move the DNS entry so the DNS alias Git users use
- Perform
git pullfor each repository on the new server. - For each repository on the new server, edit the config file to remove the
remote "origin"section. - Turn on access to new server
Questions:
- Does this look right? I am specifically concerned with step #6.
- Is there any way to do this that will reduce downtime?
Thanks.
I would (if there are no communication possible between old server and new server):
git bundlegit fetchfrom those bundles in each of the empty bare repo (no origin to set)git fetchthe increment from the small incremental bundles</ downtime: no origin to remove>
If there is communication possible (through SSL) between the new and the old server:
clone --bareeach projects on the new servergit fetchon each cloned repo</ downtime>