Is it possible to convert a regular git annex repo (git clone then git annex init in the folder), to an rsync remote. I have an annex with alot of remotes which makes the sync operation take a really long time. I would like to convert some of those remotes to rsync. This particular repo has a TB of data so I would like to avoid dropping content from the remote than re download everything.
This is doable. It works best if the remote repo is a bare git repository, because then the filenames line up 100% with the filenames used in a rsync special remote. If the git repo is not bare, the rsync special remote will first try the paths it expects, and only then fall back to the right paths, so a little extra work done. (If this became a big problem, it would not be infesable to move the files around with a script.)
Anyway, if it's a bare repo, then repo.git/annex/objects is where you want to point the rsync special remote at. With a non-bare repo, repo/.git/annex/objects/ is the location. I'd recommend moving the objects directory out to a new location, and pointing the rsyncurl at that. This way, there's no possibility of git-annex thinking one files accessed 2 ways is 2 copies.
Of course, you can't use encryption for the rsync special remote.
However, if the only problem is that pushing and pulling with a git repository makes
git annex sync
take too long, another option is settinggit config remote.$foo.annex-sync false
. You can still then use git-annex commands to get and push data to the remote, and can evengit annex sync $foo
from time to time, but it won't slow down the normalgit annex sync
.However, this also prevents the assistant from uploading new files to the remote automatically.
Thanks for the reply, just to make sure I got you right,
It is indeed a non bare git repo. So I will move the folder repo/.git/annex/objects/ to repo/
then run,
git annex initremote myrsync type=rsync rsyncurl=ssh.example.com:~/repo
and enable the remote on other annexes (disks are connected to an ssh server there is no encryption setup right now so I do not mind not having it.). And everything should be setup correctly.
That looks all-right, although initremote will ask you to tell it what encryption to use, and you'll need to specify
encryption=none
One thing I forgot to mention is that the UUID of the new rsync repository won't be the same, so git-annex won't know about the files in there. This can be fixed by
git annex fsck --fast --from myrsync
. Which doesn't re-download all the files, but you still may want to run it on a repository close to or on the server for speed.You can re-use the name you're currently using for the git remote for the new rsync special remote if you like.