[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: repository split

From: Jason Malinowski <jason_at_jason-m.com>
Date: Fri, 26 Jun 2009 09:03:14 -0500

Agreed, one repository's UUID will have to change, so it can't be 100%
transparent.

However, if you're OK making it non-transparent, and force your devs to
re-check out. The trick is to go editing your dump files after you've
ran them through svndumpfilter but before you import them. If you look
at a dump file, you will see lines like this:

Node-path: projectA/trunk/file.txt

...

Node-copyfrom-path: projectA/trunk/someotherfile.txt

In this case, do something like:

cat dumpfile | sed 's|-path: projectA/|-path: |g' > dumpfile2

And then diff the two to make sure you used sed right. ;-)

Which should (hopefully) remove the component on both. If you reload you
will find that you'll still see an empty directory called 'projectA'
with the trunk and branches directory now alongside it. This is because
the creation for the directory will look like Node-path: projectA which
doesn't have the trailing slash. To remove this, run your edited
dumpfile through svndumpfilter exclude projectA which should drop just
that one node.

Whether this is an "officially recommended" thing I can't say, but I did
this to a few repositories recently, although chose to force users to
re-check out their repositories. I cannot say if it will be a
transparent to users. My approach was simply to talk to the developers
(since there were only a few per project) and ask them when a good time
to do the change over was by waking over to them and asking. Often they
just said, "hey, now is a good time" hit commit, and then let me go
along with this.

If you're using merge tracking, doing this will likely break it since
the svn:mergeinfo properties would refer to the paths with the projectA.
Editing those would be significantly more difficult. Also in this
process you have to decide if you wish to renumber revs or not. Again,
mergeinfo will likely break if you renumber revs (unless svndumpfilter
is smarter than I suspect it is.)

Jason Malinowski

-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2009b_at_ryandesign.com]
Sent: Friday, June 26, 2009 1:40 AM
To: Vadym Chepkov
Cc: users_at_subversion.tigris.org
Subject: Re: repository split

On Jun 25, 2009, at 18:08, Vadym Chepkov wrote:

> I was using subversion with apache and just one repository, so I had
>
> SVNPath /var/svn/repos
>
> In the repository I had several projects:
> projectA
> trunk
> branches
> tags
> projectB
> trunk
> branches
> tags
>
> I decided to split one repository into two and this is what I did
>
> svnadmin dump /var/svn/repos > ~/oldrepos.dump
> rm -rf /var/svn/repos
> mkdir /var/svn/repos
> cd /var/svn/repos
> svnadmin create projectA
> cat ~/oldrepos.dump | svndumpfilter include projectA | svnadmin load
> projectA
> svnadmin create projectB
> cat ~/oldrepos.dump | svndumpfilter include projectB | svnadmin --
> ignore-uuid load projectB
>
> and changed apache to
> SVNParentPath /var/svn/repos
> SVNListParentPath On
>
> It would be almost perfect, except one thing, trunk of the URL is now
> located in
> http://server/svn/projectA/projectA/trunk instead of just http://
> server/svn/projectA/trunk
> . I understand, it's possible to shuffle directories around later, but
> I wanted this transition to be unnoticeable to users, if possible
> (that's why I inherited UUID for projectA). Is there a way to re-write
> the path somehow?

I don't think it can be a transparent transition. You must give both
new repositories new UUIDs that are different from that of the
previous combined repository, because they are different
repositories. Then all users must check out new working copies.

To fix the doubled "projectN" in the URLs, simply use "svn mv" to get
things the way you want them.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageI
d=2365601

To unsubscribe from this discussion, e-mail:
[users-unsubscribe_at_subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2365699

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-06-26 16:04:19 CEST

This is an archived mail posted to the Subversion Users mailing list.