{"thread":{"id":"64362","subject":"Migrating Repository without Network","startedAt":"2025-10-21T14:52:20Z","lastAt":"2025-10-22T15:39:24Z","messageCount":6,"participants":["Dennis Putnam","D. Ben Knoble","Junio C Hamano","Konstantin Khomoutov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"529297","messageId":"94497aac-c61a-4b17-9e4c-8ca9b966829c@bellsouth.net","threadId":"64362","inReplyTo":"94497aac-c61a-4b17-9e4c-8ca9b966829c.ref@bellsouth.net","subject":"Migrating Repository without Network","fromName":"Dennis Putnam","fromEmail":"dap1@bellsouth.net","sentAt":"2025-10-21T14:21:52Z","receivedAt":"2025-10-21T14:52:20Z","isPatch":false,"sender":{"key":"dap1@bellsouth.net","avatar":null},"body":"I have a server with a git repository whose NIC is no longer working. I \nneed to migrate that repository to a new server using a flash drive. I \ncan only find instructions for migrating when both servers have network \naccess. Can someone tell me how to do a migration without using a \nnetwork? TIA.\n"},{"id":"529330","messageId":"CALnO6CAKBB=MRUBSv-_pqWuUgi6d1+o_X=iq-fLzfSkCYMaiPw@mail.gmail.com","threadId":"64362","inReplyTo":"94497aac-c61a-4b17-9e4c-8ca9b966829c@bellsouth.net","subject":"Re: Migrating Repository without Network","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-10-21T21:23:38Z","receivedAt":"2025-10-21T21:23:52Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Tue, Oct 21, 2025 at 10:52 AM Dennis Putnam <dap1@bellsouth.net> wrote:\n>\n> I have a server with a git repository whose NIC is no longer working. I\n> need to migrate that repository to a new server using a flash drive. I\n> can only find instructions for migrating when both servers have network\n> access. Can someone tell me how to do a migration without using a\n> network? TIA.\n\nHave a look at git-bundle(1), which was designed for something similar\nto this use case I believe. Or, rsync the repo to the flash drive and\nthen off?\n\n-- \nD. Ben Knoble\n"},{"id":"529340","messageId":"xmqqo6pzsxlm.fsf@gitster.g","threadId":"64362","inReplyTo":"CALnO6CAKBB=MRUBSv-_pqWuUgi6d1+o_X=iq-fLzfSkCYMaiPw@mail.gmail.com","subject":"Re: Migrating Repository without Network","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-21T22:23:33Z","receivedAt":"2025-10-21T22:23:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"D. Ben Knoble\" <ben.knoble@gmail.com> writes:\n\n> On Tue, Oct 21, 2025 at 10:52 AM Dennis Putnam <dap1@bellsouth.net> wrote:\n>>\n>> I have a server with a git repository whose NIC is no longer working. I\n>> need to migrate that repository to a new server using a flash drive. I\n>> can only find instructions for migrating when both servers have network\n>> access. Can someone tell me how to do a migration without using a\n>> network? TIA.\n>\n> Have a look at git-bundle(1), which was designed for something similar\n> to this use case I believe. Or, rsync the repo to the flash drive and\n> then off?\n\nBut bundle is only about preserving/transporting the history\nrecorded in the repository.  It does not do the repository config or\nthe hooks.  Those folks would want to migrate the entire repository\ndata off of a failing server, so I think \"rsync/cp\" would be the\nmore sensible route.\n\nThanks.\n"},{"id":"529403","messageId":"6tygbwc6ifpuo3xylsmsveufqyroazy35u4lyblnvuls3l7n3u@d4ail3s6vtoa","threadId":"64362","inReplyTo":"94497aac-c61a-4b17-9e4c-8ca9b966829c@bellsouth.net","subject":"Re: Migrating Repository without Network","fromName":"Konstantin Khomoutov","fromEmail":"kostix@bswap.ru","sentAt":"2025-10-22T09:04:14Z","receivedAt":"2025-10-22T09:19:33Z","isPatch":false,"sender":{"key":"kostix@bswap.ru","avatar":null},"body":"On Tue, Oct 21, 2025 at 10:21:52AM -0400, Dennis Putnam wrote:\n\n> I have a server with a git repository whose NIC is no longer working. I need\n> to migrate that repository to a new server using a flash drive. I can only\n> find instructions for migrating when both servers have network access. Can\n> someone tell me how to do a migration without using a network? TIA.\n\nNote that Git repositories - both \"bare\" which are typical for servers [1] -\nand \"normal\" - which usually get created when the folks clone repositories\nfrom centralized locations, are self-containing, so what you should do is to\njust physcally copy the directory with the repository to the flash drive,\nrecursively. Then make sure you have another copy of it, just in case you'll\nscrew something later.\n\nThen, once you have the repository on the flash drive, what to do heavily\ndepends on how the access to that repository was provided - simply because\nthere are many ways to do that - say, via SSH with several real system\naccounts, via SSH with a single \"virtual\" user, via HTTP[S] with the\nauthentication provided by the mediating web server, and so on; it is also\npossible to combine these ways of access. It is also possible that the repo\nis under the control of some turn-key solution such as GitLab, Gitea etc.\nSo, in the end, what to do next depends on what setup *around* that Git repo\nyou have right now.\n\nIn either case, it will be possible to fetch all the data from the repo saved\non the flash drive: it might be not exactly obvious but all Git commands which\nfetch data - such as \"clone\", \"fetch\" etc - do understand \"plain\" pathnames\nsuch as /the/path/to/the/repo and URLs with the special scheme \"file://\" -\nsuch as file:///the/path/to/the/repo, allowing them to work with on-disk repos\navailable locally such as on a mounted flash drive.\n\n 1. https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server\n\n"},{"id":"529405","messageId":"yfg4ow3ndckqr6zvrbvldbynv2jgaf5ip76phusdtiwelnz4e2@5e5hct2uujo5","threadId":"64362","inReplyTo":"6tygbwc6ifpuo3xylsmsveufqyroazy35u4lyblnvuls3l7n3u@d4ail3s6vtoa","subject":"Re: Migrating Repository without Network","fromName":"Konstantin Khomoutov","fromEmail":"kostix@bswap.ru","sentAt":"2025-10-22T09:14:48Z","receivedAt":"2025-10-22T09:30:07Z","isPatch":false,"sender":{"key":"kostix@bswap.ru","avatar":null},"body":"On Wed, Oct 22, 2025 at 12:04:15PM +0300, Konstantin Khomoutov wrote:\n\n[...]\n> In either case, it will be possible to fetch all the data from the repo\n> saved on the flash drive: it might be not exactly obvious but all Git\n> commands which fetch data - such as \"clone\", \"fetch\" etc - do understand\n> \"plain\" pathnames such as /the/path/to/the/repo and URLs with the special\n> scheme \"file://\" - such as file:///the/path/to/the/repo, allowing them to\n> work with on-disk repos available locally such as on a mounted flash drive.\n\n...it should be noted, though, that \"normal\" and \"bare\" repository have\ndifferent schemes of storing branches available in them, and it might affect\nthe approach you will need to employ to fetch really *all* the data to form a\nnew repo.\n\nIt's hardly possible to dive further in this topic because we have next to\nzero knowledge about your setup - including whether that repo is bare and is\naccessed from the outside, or normal and merely shared between the users\nphysically logged into the server and so on. I mean, it may so happen that all\nyou will need to do is to copy the repo to a flash drive and then copy it\nagain to the new server, possibly fix filesystem permissions on it so that\nthey match the ones the old repo has, and call it a day. In case you will need\nmore advanced help, you'll need to provide more details on your situation.\n\n"},{"id":"529425","messageId":"16b5dc64-201e-4796-942e-1e6e2f386ce8@bellsouth.net","threadId":"64362","inReplyTo":"6tygbwc6ifpuo3xylsmsveufqyroazy35u4lyblnvuls3l7n3u@d4ail3s6vtoa","subject":"Re: Migrating Repository without Network","fromName":"Dennis Putnam","fromEmail":"dap1@bellsouth.net","sentAt":"2025-10-22T15:29:08Z","receivedAt":"2025-10-22T15:39:24Z","isPatch":false,"sender":{"key":"dap1@bellsouth.net","avatar":null},"body":"Thanks for the reply. I'm not a git expert (obviously) so I am not sure \nof some of the terminology. This is a remote repository that is accessed \nvia SSH from various clients. Does that clarify things?\n\nOn 10/22/2025 5:04 AM, Konstantin Khomoutov wrote:\n> On Tue, Oct 21, 2025 at 10:21:52AM -0400, Dennis Putnam wrote:\n>\n>> I have a server with a git repository whose NIC is no longer working. I need\n>> to migrate that repository to a new server using a flash drive. I can only\n>> find instructions for migrating when both servers have network access. Can\n>> someone tell me how to do a migration without using a network? TIA.\n> Note that Git repositories - both \"bare\" which are typical for servers [1] -\n> and \"normal\" - which usually get created when the folks clone repositories\n> from centralized locations, are self-containing, so what you should do is to\n> just physcally copy the directory with the repository to the flash drive,\n> recursively. Then make sure you have another copy of it, just in case you'll\n> screw something later.\n>\n> Then, once you have the repository on the flash drive, what to do heavily\n> depends on how the access to that repository was provided - simply because\n> there are many ways to do that - say, via SSH with several real system\n> accounts, via SSH with a single \"virtual\" user, via HTTP[S] with the\n> authentication provided by the mediating web server, and so on; it is also\n> possible to combine these ways of access. It is also possible that the repo\n> is under the control of some turn-key solution such as GitLab, Gitea etc.\n> So, in the end, what to do next depends on what setup *around* that Git repo\n> you have right now.\n>\n> In either case, it will be possible to fetch all the data from the repo saved\n> on the flash drive: it might be not exactly obvious but all Git commands which\n> fetch data - such as \"clone\", \"fetch\" etc - do understand \"plain\" pathnames\n> such as /the/path/to/the/repo and URLs with the special scheme \"file://\" -\n> such as file:///the/path/to/the/repo, allowing them to work with on-disk repos\n> available locally such as on a mounted flash drive.\n>\n>   1. https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server\n>\n\n"}]}