public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* Migrating Repository without Network
       [not found] <94497aac-c61a-4b17-9e4c-8ca9b966829c.ref@bellsouth.net>
@ 2025-10-21 14:21 ` Dennis Putnam
  2025-10-21 21:23   ` D. Ben Knoble
  2025-10-22  9:04   ` Konstantin Khomoutov
  0 siblings, 2 replies; 6+ messages in thread
From: Dennis Putnam @ 2025-10-21 14:21 UTC (permalink / raw)
  To: git


[-- Attachment #1.1: Type: text/plain, Size: 304 bytes --]

I have a server with a git repository whose NIC is no longer working. I 
need to migrate that repository to a new server using a flash drive. I 
can only find instructions for migrating when both servers have network 
access. Can someone tell me how to do a migration without using a 
network? TIA.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 203 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Migrating Repository without Network
  2025-10-21 14:21 ` Migrating Repository without Network Dennis Putnam
@ 2025-10-21 21:23   ` D. Ben Knoble
  2025-10-21 22:23     ` Junio C Hamano
  2025-10-22  9:04   ` Konstantin Khomoutov
  1 sibling, 1 reply; 6+ messages in thread
From: D. Ben Knoble @ 2025-10-21 21:23 UTC (permalink / raw)
  To: Dennis Putnam; +Cc: git

On Tue, Oct 21, 2025 at 10:52 AM Dennis Putnam <dap1@bellsouth•net> wrote:
>
> I have a server with a git repository whose NIC is no longer working. I
> need to migrate that repository to a new server using a flash drive. I
> can only find instructions for migrating when both servers have network
> access. Can someone tell me how to do a migration without using a
> network? TIA.

Have a look at git-bundle(1), which was designed for something similar
to this use case I believe. Or, rsync the repo to the flash drive and
then off?

-- 
D. Ben Knoble

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Migrating Repository without Network
  2025-10-21 21:23   ` D. Ben Knoble
@ 2025-10-21 22:23     ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2025-10-21 22:23 UTC (permalink / raw)
  To: D. Ben Knoble; +Cc: Dennis Putnam, git

"D. Ben Knoble" <ben.knoble@gmail•com> writes:

> On Tue, Oct 21, 2025 at 10:52 AM Dennis Putnam <dap1@bellsouth•net> wrote:
>>
>> I have a server with a git repository whose NIC is no longer working. I
>> need to migrate that repository to a new server using a flash drive. I
>> can only find instructions for migrating when both servers have network
>> access. Can someone tell me how to do a migration without using a
>> network? TIA.
>
> Have a look at git-bundle(1), which was designed for something similar
> to this use case I believe. Or, rsync the repo to the flash drive and
> then off?

But bundle is only about preserving/transporting the history
recorded in the repository.  It does not do the repository config or
the hooks.  Those folks would want to migrate the entire repository
data off of a failing server, so I think "rsync/cp" would be the
more sensible route.

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Migrating Repository without Network
  2025-10-21 14:21 ` Migrating Repository without Network Dennis Putnam
  2025-10-21 21:23   ` D. Ben Knoble
@ 2025-10-22  9:04   ` Konstantin Khomoutov
  2025-10-22  9:14     ` Konstantin Khomoutov
  2025-10-22 15:29     ` Dennis Putnam
  1 sibling, 2 replies; 6+ messages in thread
From: Konstantin Khomoutov @ 2025-10-22  9:04 UTC (permalink / raw)
  To: Dennis Putnam; +Cc: git

On Tue, Oct 21, 2025 at 10:21:52AM -0400, Dennis Putnam wrote:

> I have a server with a git repository whose NIC is no longer working. I need
> to migrate that repository to a new server using a flash drive. I can only
> find instructions for migrating when both servers have network access. Can
> someone tell me how to do a migration without using a network? TIA.

Note that Git repositories - both "bare" which are typical for servers [1] -
and "normal" - which usually get created when the folks clone repositories
from centralized locations, are self-containing, so what you should do is to
just physcally copy the directory with the repository to the flash drive,
recursively. Then make sure you have another copy of it, just in case you'll
screw something later.

Then, once you have the repository on the flash drive, what to do heavily
depends on how the access to that repository was provided - simply because
there are many ways to do that - say, via SSH with several real system
accounts, via SSH with a single "virtual" user, via HTTP[S] with the
authentication provided by the mediating web server, and so on; it is also
possible to combine these ways of access. It is also possible that the repo
is under the control of some turn-key solution such as GitLab, Gitea etc.
So, in the end, what to do next depends on what setup *around* that Git repo
you have right now.

In either case, it will be possible to fetch all the data from the repo saved
on the flash drive: it might be not exactly obvious but all Git commands which
fetch data - such as "clone", "fetch" etc - do understand "plain" pathnames
such as /the/path/to/the/repo and URLs with the special scheme "file://" -
such as file:///the/path/to/the/repo, allowing them to work with on-disk repos
available locally such as on a mounted flash drive.

 1. https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Migrating Repository without Network
  2025-10-22  9:04   ` Konstantin Khomoutov
@ 2025-10-22  9:14     ` Konstantin Khomoutov
  2025-10-22 15:29     ` Dennis Putnam
  1 sibling, 0 replies; 6+ messages in thread
From: Konstantin Khomoutov @ 2025-10-22  9:14 UTC (permalink / raw)
  To: Dennis Putnam; +Cc: git

On Wed, Oct 22, 2025 at 12:04:15PM +0300, Konstantin Khomoutov wrote:

[...]
> In either case, it will be possible to fetch all the data from the repo
> saved on the flash drive: it might be not exactly obvious but all Git
> commands which fetch data - such as "clone", "fetch" etc - do understand
> "plain" pathnames such as /the/path/to/the/repo and URLs with the special
> scheme "file://" - such as file:///the/path/to/the/repo, allowing them to
> work with on-disk repos available locally such as on a mounted flash drive.

...it should be noted, though, that "normal" and "bare" repository have
different schemes of storing branches available in them, and it might affect
the approach you will need to employ to fetch really *all* the data to form a
new repo.

It's hardly possible to dive further in this topic because we have next to
zero knowledge about your setup - including whether that repo is bare and is
accessed from the outside, or normal and merely shared between the users
physically logged into the server and so on. I mean, it may so happen that all
you will need to do is to copy the repo to a flash drive and then copy it
again to the new server, possibly fix filesystem permissions on it so that
they match the ones the old repo has, and call it a day. In case you will need
more advanced help, you'll need to provide more details on your situation.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Migrating Repository without Network
  2025-10-22  9:04   ` Konstantin Khomoutov
  2025-10-22  9:14     ` Konstantin Khomoutov
@ 2025-10-22 15:29     ` Dennis Putnam
  1 sibling, 0 replies; 6+ messages in thread
From: Dennis Putnam @ 2025-10-22 15:29 UTC (permalink / raw)
  To: git


[-- Attachment #1.1: Type: text/plain, Size: 2251 bytes --]

Thanks for the reply. I'm not a git expert (obviously) so I am not sure 
of some of the terminology. This is a remote repository that is accessed 
via SSH from various clients. Does that clarify things?

On 10/22/2025 5:04 AM, Konstantin Khomoutov wrote:
> On Tue, Oct 21, 2025 at 10:21:52AM -0400, Dennis Putnam wrote:
>
>> I have a server with a git repository whose NIC is no longer working. I need
>> to migrate that repository to a new server using a flash drive. I can only
>> find instructions for migrating when both servers have network access. Can
>> someone tell me how to do a migration without using a network? TIA.
> Note that Git repositories - both "bare" which are typical for servers [1] -
> and "normal" - which usually get created when the folks clone repositories
> from centralized locations, are self-containing, so what you should do is to
> just physcally copy the directory with the repository to the flash drive,
> recursively. Then make sure you have another copy of it, just in case you'll
> screw something later.
>
> Then, once you have the repository on the flash drive, what to do heavily
> depends on how the access to that repository was provided - simply because
> there are many ways to do that - say, via SSH with several real system
> accounts, via SSH with a single "virtual" user, via HTTP[S] with the
> authentication provided by the mediating web server, and so on; it is also
> possible to combine these ways of access. It is also possible that the repo
> is under the control of some turn-key solution such as GitLab, Gitea etc.
> So, in the end, what to do next depends on what setup *around* that Git repo
> you have right now.
>
> In either case, it will be possible to fetch all the data from the repo saved
> on the flash drive: it might be not exactly obvious but all Git commands which
> fetch data - such as "clone", "fetch" etc - do understand "plain" pathnames
> such as /the/path/to/the/repo and URLs with the special scheme "file://" -
> such as file:///the/path/to/the/repo, allowing them to work with on-disk repos
> available locally such as on a mounted flash drive.
>
>   1. https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server
>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 203 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-10-22 15:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <94497aac-c61a-4b17-9e4c-8ca9b966829c.ref@bellsouth.net>
2025-10-21 14:21 ` Migrating Repository without Network Dennis Putnam
2025-10-21 21:23   ` D. Ben Knoble
2025-10-21 22:23     ` Junio C Hamano
2025-10-22  9:04   ` Konstantin Khomoutov
2025-10-22  9:14     ` Konstantin Khomoutov
2025-10-22 15:29     ` Dennis Putnam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox