You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Lira Olavo <Ol...@gemalto.com> on 2008/09/12 22:01:46 UTC

svn:external and server migration

Hello to all, 

 

            I have to migrate SVN from server A and B to server C and D
respectively. The problem is that I have several projects from server A pointing
to server B and vive-verse using svn:externals, like: https://A/svn/... and
https://B/svn/

            How can I have in my new server C and D those svn:esternals as
https://C/svn/... and https://D/svn/?

 

Thank you very much for your attention!

 

Olavo Lira


RE: svn:external and server migration

Posted by Lira Olavo <Ol...@gemalto.com>.
Oh yes, Cristal clear!

Thank you so much!!

Olavo Lira

-----Original Message-----
From: Purple Streak [mailto:mrpurplestreak@googlemail.com] 
Sent: Wednesday, September 17, 2008 3:07 PM
To: Lira Olavo
Cc: svn [usr]
Subject: Re: svn:external and server migration

2008/9/17 Lira Olavo <Ol...@gemalto.com>:
> What they mean by " relative to the scheme" for instance?
>
>        Could you give an example how this 2 old-fashioned properties would
look
> like when using the new format?
>
>        Link 1: DirB https://server/repositoryA/Project1/DirA
>        Link 2: DirA https://server/repositoryB/Project2/DirB
>

relative to the scheme just means you can omit the https: at the front - e.g.

//server/repositoryA/Project1/DirA DirB
//server/repositoryB/Project2/DirB DirA

All this means if that if at some point a client connect to the
repository with svn:// (instead of https://) then the external would
still work

If the repositories are on the same server (like the 2 above would be)
then you can go one better and omit the //server bit to give...

/repositoryA/Project1/DirA DirB
/repositoryB/Project2/DirB DirA

Now when the client gets the external it takes the schema (svn:// or
https://) AND the server name from it's connection and prepends that
to the external before getting it.

Does that make it clearer?

Re: svn:external and server migration

Posted by Purple Streak <mr...@googlemail.com>.
2008/9/17 Lira Olavo <Ol...@gemalto.com>:
> What they mean by " relative to the scheme" for instance?
>
>        Could you give an example how this 2 old-fashioned properties would look
> like when using the new format?
>
>        Link 1: DirB https://server/repositoryA/Project1/DirA
>        Link 2: DirA https://server/repositoryB/Project2/DirB
>

relative to the scheme just means you can omit the https: at the front - e.g.

//server/repositoryA/Project1/DirA DirB
//server/repositoryB/Project2/DirB DirA

All this means if that if at some point a client connect to the
repository with svn:// (instead of https://) then the external would
still work

If the repositories are on the same server (like the 2 above would be)
then you can go one better and omit the //server bit to give...

/repositoryA/Project1/DirA DirB
/repositoryB/Project2/DirB DirA

Now when the client gets the external it takes the schema (svn:// or
https://) AND the server name from it's connection and prepends that
to the external before getting it.

Does that make it clearer?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: svn:external and server migration

Posted by Lira Olavo <Ol...@gemalto.com>.
Hello to all, 

	Thanks a lot for all your help it really helped! I created a script to
run the regexp several times to change all the properties (is there a way to
call the python do do it for me?). 
	The problem is that I'm still using the old format of links. I read many
times about the new way in
http://subversion.tigris.org/svn_1.5_releasenotes.html#externals but I could
understand how it can help on my case where I have 2 different repositories.
What they mean by " relative to the scheme" for instance?

	Could you give an example how this 2 old-fashioned properties would look
like when using the new format?

	Link 1: DirB https://server/repositoryA/Project1/DirA
	Link 2: DirA https://server/repositoryB/Project2/DirB

Thank you once more, you are really helping me out with those information!!!

Olavo Lira

-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2008c@ryandesign.com] 
Sent: Sunday, September 14, 2008 12:40 PM
To: Purple Streak
Cc: svn [usr]; Lira Olavo
Subject: Re: svn:external and server migration

On Sep 14, 2008, at 3:45 AM, Purple Streak wrote:

> Ryan Schmidt wrote:
>
>> Sure. I just had to do this on one of my own repositories so I can  
>> show you
>> what I used. My repository had been created before Subversion 1.5,  
>> and my
>> externals definitions were absolute, like yours, since that's all  
>> one could
>> do at the time.
>
> But if I read Lira's mail right she has externals in Repo A pointing
> to externals in Repo B where A and B are different servers so a repo
> relative external won't help will it

Oh whoops, you're right.

> (all you could hope to remove is
> the https:// so you could switch to svn:// more easily)?

You can do better than that actually. Subversion 1.5 offers many  
externals formats now:

http://subversion.tigris.org/svn_1.5_releasenotes.html#externals

I was using "^/ (Relative to the repository root)" because that  
worked for me. But Lira could use "../ Relative to the directory with  
the svn:externals property" or "// Relative to the scheme" or "/  
Server root relative URLs." I wouldn't recommend relative to the  
scheme (you'd have to keep repeating the hostname in your externals  
definitions) but relative to the server root should work well,  
assuming you don't plan to change where within your host's URL space  
the repositories are stored.


> However if I read Ryan's script correctly it's all in the line that
> does the url changing.
>
> '^(\S+) http://url/to/old/repo(\S+)' '^\2 \1'

Exactly. For each line of every svn:externals definition, it matches  
and remembers the first word, and the path within the repository at  
the old URL, and replaces it with those two in reversed order, with a  
"^" in front of the repository path to make it a repository relative  
definition.


> My regexp's are always rusty but if you were dumping server A's repo
> the above regexp needs to be changed replace https://Repo B/.... with
> https://Repo D/... and keep the rest of the URL the same. Maybe
> something like...
>
> '^(\S+) http://Repo B(\S+)' '^\1 http://Repo D\2'
>
> (but I would double check that line first!)



Re: svn:external and server migration

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 14, 2008, at 3:45 AM, Purple Streak wrote:

> Ryan Schmidt wrote:
>
>> Sure. I just had to do this on one of my own repositories so I can  
>> show you
>> what I used. My repository had been created before Subversion 1.5,  
>> and my
>> externals definitions were absolute, like yours, since that's all  
>> one could
>> do at the time.
>
> But if I read Lira's mail right she has externals in Repo A pointing
> to externals in Repo B where A and B are different servers so a repo
> relative external won't help will it

Oh whoops, you're right.

> (all you could hope to remove is
> the https:// so you could switch to svn:// more easily)?

You can do better than that actually. Subversion 1.5 offers many  
externals formats now:

http://subversion.tigris.org/svn_1.5_releasenotes.html#externals

I was using "^/ (Relative to the repository root)" because that  
worked for me. But Lira could use "../ Relative to the directory with  
the svn:externals property" or "// Relative to the scheme" or "/  
Server root relative URLs." I wouldn't recommend relative to the  
scheme (you'd have to keep repeating the hostname in your externals  
definitions) but relative to the server root should work well,  
assuming you don't plan to change where within your host's URL space  
the repositories are stored.


> However if I read Ryan's script correctly it's all in the line that
> does the url changing.
>
> '^(\S+) http://url/to/old/repo(\S+)' '^\2 \1'

Exactly. For each line of every svn:externals definition, it matches  
and remembers the first word, and the path within the repository at  
the old URL, and replaces it with those two in reversed order, with a  
"^" in front of the repository path to make it a repository relative  
definition.


> My regexp's are always rusty but if you were dumping server A's repo
> the above regexp needs to be changed replace https://Repo B/.... with
> https://Repo D/... and keep the rest of the URL the same. Maybe
> something like...
>
> '^(\S+) http://Repo B(\S+)' '^\1 http://Repo D\2'
>
> (but I would double check that line first!)



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn:external and server migration

Posted by Purple Streak <mr...@googlemail.com>.
2008/9/13 Ryan Schmidt <su...@ryandesign.com>:
> Sure. I just had to do this on one of my own repositories so I can show you
> what I used. My repository had been created before Subversion 1.5, and my
> externals definitions were absolute, like yours, since that's all one could
> do at the time.

But if I read Lira's mail right she has externals in Repo A pointing
to externals in Repo B where A and B are different servers so a repo
relative external won't help will it (all you could hope to remove is
the https:// so you could switch to svn:// more easily)?

However if I read Ryan's script correctly it's all in the line that
does the url changing.

'^(\S+) http://url/to/old/repo(\S+)' '^\2 \1'

My regexp's are always rusty but if you were dumping server A's repo
the above regexp needs to be changed replace https://Repo B/.... with
https://Repo D/... and keep the rest of the URL the same. Maybe
something like...

'^(\S+) http://Repo B(\S+)' '^\1 http://Repo D\2'

(but I would double check that line first!)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn:external and server migration

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 13, 2008, at 11:24 AM, Lira Olavo wrote:

> Ryan Schmidt wrote:
>
>> On Sep 12, 2008, at 17:01, Lira Olavo wrote:
>>
>>>             I have to migrate SVN from server A and B to server C
>>> and D respectively. The problem is that I have several projects
>>> from server A pointing to server B and vive-verse using
>>> svn:externals, like: https://A/svn/... andhttps://B/svn/
>>>             How can I have in my new server C and D those
>>> svn:esternals as https://C/svn/... and https://D/svn/?
>>
>> Upgrade to at least Subversion 1.5 on the client, which supports
>> relative externals.
>>
>> http://subversion.tigris.org/svn_1.5_releasenotes.html#externals
>>
>> Dump your repository, then change the absolute externals you have now
>> into relative externals using svndumptool.
>>
>> http://svn.borg.ch/svndumptool/
>>
>> Then load the modified dump into your new empty repository.
>>
>> All users should delete their working copies and check out new ones.
>
> 	Thank you for your answer but it is still not clear for me how I
> can use the svndumptool to do it in an automated way.
> 	I saw the command Transform-prop and edit, but I'm not sure that
> is what you meant. Could you please provide me an example or more  
> detail
> on how to do this operation with svndumptool please?

Sure. I just had to do this on one of my own repositories so I can  
show you what I used. My repository had been created before  
Subversion 1.5, and my externals definitions were absolute, like  
yours, since that's all one could do at the time.

Now I wanted to switch to relative externals so that my repository  
URL was no longer hardcoded into the externals, so that I could be  
free to change my repository URL if needed.

"svndumptool.py edit" is for replacing the contents of files, so  
that's not applicable.

"svndumptool.py transform-prop" is for transforming versioned  
properties, and svn:externals is a versioned property, so that's what  
we'll use.

I did something like this:


SVNADMIN="svnadmin"
SVNDUMPTOOL="svndumptool.py"
CREATE="$SVNADMIN create"
LOAD="$SVNADMIN load --ignore-uuid"
DUMP="$SVNADMIN dump"

$DUMP /path/to/old/repo > dump

$SVNDUMPTOOL transform-prop svn:externals \
'^(\S+) http://url/to/old/repo(\S+)' '^\2 \1' \
dump dump-transformed

$CREATE /path/to/new/repo
$LOAD /path/to/new/repo < dump-transformed


Note that you won't be able to check out from the new repository  
using Subversion clients earlier than 1.5 because they don't know  
about relative externals.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: svn:external and server migration

Posted by Lira Olavo <Ol...@gemalto.com>.
Hello Ryan, 

	Thank you for your answer but it is still not clear for me how I
can use the svndumptool to do it in an automated way.
	I saw the command Transform-prop and edit, but I'm not sure that
is what you meant. Could you please provide me an example or more detail
on how to do this operation with svndumptool please?

Thank you very much!

Olavo Lira

-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2008c@ryandesign.com] 
Sent: Friday, September 12, 2008 6:53 PM
To: Lira Olavo
Cc: svn [usr]
Subject: Re: svn:external and server migration


On Sep 12, 2008, at 17:01, Lira Olavo wrote:

>             I have to migrate SVN from server A and B to server C  
> and D respectively. The problem is that I have several projects  
> from server A pointing to server B and vive-verse using  
> svn:externals, like: https://A/svn/... andhttps://B/svn/
>             How can I have in my new server C and D those  
> svn:esternals as https://C/svn/... and https://D/svn/?

Upgrade to at least Subversion 1.5 on the client, which supports  
relative externals.

http://subversion.tigris.org/svn_1.5_releasenotes.html#externals

Dump your repository, then change the absolute externals you have now  
into relative externals using svndumptool.

http://svn.borg.ch/svndumptool/

Then load the modified dump into your new empty repository.

All users should delete their working copies and check out new ones.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: svn:external and server migration

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 12, 2008, at 17:01, Lira Olavo wrote:

>             I have to migrate SVN from server A and B to server C  
> and D respectively. The problem is that I have several projects  
> from server A pointing to server B and vive-verse using  
> svn:externals, like: https://A/svn/... andhttps://B/svn/
>             How can I have in my new server C and D those  
> svn:esternals as https://C/svn/... and https://D/svn/?

Upgrade to at least Subversion 1.5 on the client, which supports  
relative externals.

http://subversion.tigris.org/svn_1.5_releasenotes.html#externals

Dump your repository, then change the absolute externals you have now  
into relative externals using svndumptool.

http://svn.borg.ch/svndumptool/

Then load the modified dump into your new empty repository.

All users should delete their working copies and check out new ones.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org