Discussion:
SVNSYNC questions
Paul Greene
2018-05-02 20:02:31 UTC
Permalink
Hello Subversion gurus,

I need to create a mirror of a subversion repository.

Prior to running svnsync, do I need to create the same folder structure on
the destination as on the source?

i.e. the source has 110 repositories located under /data/subversion. I have
a folder named /data/subversion on the destination as well where I want the
mirror to go.

Do I need to manually create all the subversion repository folders under
/data/subversion before syncing, along with the same user
permissions/ownership? Or does subversion automatically create the folders?

Thanks,

PG
Andreas Stieger
2018-05-02 20:09:01 UTC
Permalink
Hello,
Post by Paul Greene
Prior to running svnsync, do I need to create the same folder
structure on the destination as on the source?
no, just an empty, randomly named repository.
Post by Paul Greene
i.e. the source has 110 repositories located under /data/subversion. I
have a folder named /data/subversion on the destination as well where
I want the mirror to go.
You need to have as many repositories on the far side as you need
mirroring for. The on-disk data will look like this: conf  db  format 
hooks  locks  README.txt
Each of these is a synchronization unit and needs to be set up
separately. svn does not help you above that level, and below that any
structure only exists inside the repository tree which is replicated.
Post by Paul Greene
Do I need to manually create all the subversion repository folders
under /data/subversion before syncing, along with the same user
permissions/ownership? Or does subversion automatically create the folders?
Depends if /data/subversion IS the repository, or CONTAINS repositories.

Andreas
Paul Greene
2018-05-02 20:16:40 UTC
Permalink
/data/subversion *contains* the repositories - it is not a repository
itself.

So, will the /data/subversion/repo01, /data/subversion/repo02, ...
/data/subversion/repo110 automatically be created, or do I have to make
them myself?
Post by Andreas Stieger
Hello,
Post by Paul Greene
Prior to running svnsync, do I need to create the same folder
structure on the destination as on the source?
no, just an empty, randomly named repository.
Post by Paul Greene
i.e. the source has 110 repositories located under /data/subversion. I
have a folder named /data/subversion on the destination as well where
I want the mirror to go.
You need to have as many repositories on the far side as you need
mirroring for. The on-disk data will look like this: conf db format
hooks locks README.txt
Each of these is a synchronization unit and needs to be set up
separately. svn does not help you above that level, and below that any
structure only exists inside the repository tree which is replicated.
Post by Paul Greene
Do I need to manually create all the subversion repository folders
under /data/subversion before syncing, along with the same user
permissions/ownership? Or does subversion automatically create the folders?
Depends if /data/subversion IS the repository, or CONTAINS repositories.
Andreas
Geoff Rowell
2018-05-02 20:40:38 UTC
Permalink
1. Create the destination repositories.
2. Configure the destination repository access rights.
3. Use "svnsync init" on each destination repository.
4. Run "svnsync sync" on each to copy content.
Post by Paul Greene
/data/subversion *contains* the repositories - it is not a repository
itself.
So, will the /data/subversion/repo01, /data/subversion/repo02, ...
/data/subversion/repo110 automatically be created, or do I have to make
them myself?
Post by Andreas Stieger
Hello,
Post by Paul Greene
Prior to running svnsync, do I need to create the same folder
structure on the destination as on the source?
no, just an empty, randomly named repository.
Post by Paul Greene
i.e. the source has 110 repositories located under /data/subversion. I
have a folder named /data/subversion on the destination as well where
I want the mirror to go.
You need to have as many repositories on the far side as you need
mirroring for. The on-disk data will look like this: conf db format
hooks locks README.txt
Each of these is a synchronization unit and needs to be set up
separately. svn does not help you above that level, and below that any
structure only exists inside the repository tree which is replicated.
Post by Paul Greene
Do I need to manually create all the subversion repository folders
under /data/subversion before syncing, along with the same user
permissions/ownership? Or does subversion automatically create the folders?
Depends if /data/subversion IS the repository, or CONTAINS repositories.
Andreas
--
Geoff Rowell
***@gmail.com
Paul Greene
2018-05-02 20:43:06 UTC
Permalink
Ok, thanks, I was hoping I wouldn't have to manually create 110 folders and
set permissions, but it is what it is.
Post by Geoff Rowell
1. Create the destination repositories.
2. Configure the destination repository access rights.
3. Use "svnsync init" on each destination repository.
4. Run "svnsync sync" on each to copy content.
Post by Paul Greene
/data/subversion *contains* the repositories - it is not a repository
itself.
So, will the /data/subversion/repo01, /data/subversion/repo02, ...
/data/subversion/repo110 automatically be created, or do I have to make
them myself?
Post by Andreas Stieger
Hello,
Post by Paul Greene
Prior to running svnsync, do I need to create the same folder
structure on the destination as on the source?
no, just an empty, randomly named repository.
Post by Paul Greene
i.e. the source has 110 repositories located under /data/subversion. I
have a folder named /data/subversion on the destination as well where
I want the mirror to go.
You need to have as many repositories on the far side as you need
mirroring for. The on-disk data will look like this: conf db format
hooks locks README.txt
Each of these is a synchronization unit and needs to be set up
separately. svn does not help you above that level, and below that any
structure only exists inside the repository tree which is replicated.
Post by Paul Greene
Do I need to manually create all the subversion repository folders
under /data/subversion before syncing, along with the same user
permissions/ownership? Or does subversion automatically create the folders?
Depends if /data/subversion IS the repository, or CONTAINS repositories.
Andreas
--
Geoff Rowell
Bo Berglund
2018-05-02 21:13:28 UTC
Permalink
On Wed, 2 May 2018 16:43:06 -0400, Paul Greene
Post by Paul Greene
Ok, thanks, I was hoping I wouldn't have to manually create 110 folders and
set permissions, but it is what it is.
And additionally since you have 110 repositories you need to run
svnsync against each of these every time you want the sync to
happen...

I have structured my repos (9 of them) to contain the projects as top
level directories, so there is only one command to run per repo to
sync it with all of the upwards of 50-100 projects in each repo.
--
Bo Berglund
Developer in Sweden
Nico Kadel-Garcia
2018-05-02 21:52:50 UTC
Permalink
Post by Bo Berglund
On Wed, 2 May 2018 16:43:06 -0400, Paul Greene
Post by Paul Greene
Ok, thanks, I was hoping I wouldn't have to manually create 110 folders and
set permissions, but it is what it is.
And additionally since you have 110 repositories you need to run
svnsync against each of these every time you want the sync to
happen...
I have structured my repos (9 of them) to contain the projects as top
level directories, so there is only one command to run per repo to
sync it with all of the upwards of 50-100 projects in each repo.
This is a very common but increasingly dangerous optimization as the
number of repositories grows. It makes all repositories dependent on a
single system, and makes rmanaging accidental bulky or high frequency
commits much harder to backup or cleanup.
Andreas Stieger
2018-05-02 22:15:05 UTC
Permalink
Please consider stopping to top-post.
Post by Paul Greene
Ok, thanks, I was hoping I wouldn't have to manually create 110
folders and set permissions, but it is what it is.
Is that not something what a shell is usually happy to do for you in a loop?

Anyway, as you may have already read from the documentation, svnsync can
be initialized on non-empty destination repositories which represent a
past state of the on-disk data. One would normally use the hotcopy
operation to get such a consistent copy. However,  if you can stop
commits for a bit this can be done using file system level tools such a
cp/tar/rsync/lvm, some of which can preserve permissions. This has the
added benefit of bypassing the initial sync time, which can be
significant for repositories of non-trivial size.

Andreas

Loading...