You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Alan Taylor <at...@ieee.org> on 2011/01/13 01:22:23 UTC

project vs. repository

Greetings,

Some time ago I created my repo with:
svnadmin create /srv/svn/cfg

This has been operating fine for over a year, but I now have
a problem because I want to add another project.
Unfortunately I think the original repo creation command
should have been:
svnadmin create /srv/svn

My problem is that cfg should be a project within the repo
and now I want to add another project, i.e.
/srv/svn/cfg
/srv/svn/pxe

What is the best way to move things around ?

Rgds/Alan

Re: project vs. repository

Posted by Alan Taylor <at...@ieee.org>.
On Fri, Jan 14, 2011 at 11:37, Edward Ned Harvey <sv...@nedharvey.com> wrote:
>> From: alan.james.taylor@gmail.com [mailto:alan.james.taylor@gmail.com]
>> On Behalf Of Alan Taylor
>>
>> My problem is that cfg should be a project within the repo
>> and now I want to add another project, i.e.
>> /srv/svn/cfg
>> /srv/svn/pxe
>>
>> What is the best way to move things around ?
>
> This was already said by David, but it was rather buried deep in there...
> So just to make sure it didn't sneak past you...
>
> Read the man pages for each of these, cuz I'm leaving out some details.  But
> these are the main ingredients.
> mkdir foo
> svnadmin create foo
> svnadmin dump /srv/svn/cfg | svnadmin load foo --parent-dir cfg
> mv /srv/svn /srv/svn_old
> mv foo /srv/svn
>
>
Thank you to everyone for taking the time to reply. It was very
helpful and the move seems to have gone fairly well. For anyone
considering the same thing, here's what happened:

I originally created the repository with
svnadmin create /srv/svn/cfg
(mistake !)

I use the svnserve server with sasl authentication.

I want to move the repository root to /srv/svn/ and have that contain
several projects:
/srv/svn/cfg (current)
/srv/svn/pxe (new)

on the svn server:
svnadmin dump /srv/svn/cfg > cfg_orig
copy cfg_orig and /srv/svn/cfg/conf/svnserve.conf to somewhere safe
as a precaution I also backed up the /srv/svn/cfg directory with the
os normal filesystem tools.
deleted /srv/svn/ and everything below it

svnadmin create /srv/svn
svn mkdir file:///srv/svn/cfg
svn mkdir file:///srv/svn/cfg/trunk
svn mkdir file:///srv/svn/cfg/branches
svn mkdir file:///srv/svn/cfg/tags
svnadmin load /srv/svn/ --parent-dir cfg < tmp/cfg_orig
chown -cR svn:svn /srv/svn/*
chmod g+w /srv/svn/db/rep-cache.db
(not sure about the last, supposed bug in svn 1.6 ?)
service svnserve restart

on my normal client workstation (titan is the svn server):
$svn mkdir svn://titan/pxe
$svn mkdir svn://titan/pxe/trunk
$svn mkdir svn://titan/pxe/branches
$svn mkdir svn://titan/pxe/tags
$svn import /some_directory/pxe_files svn://titan/pxe/trunk -m
"Initial import from cfg"

$ svn checkout svn://titan/cfg/trunk cfg/
$ svn checkout svn://titan/pxe/trunk pxe/

Seems to be working fine. Initially created the pxe hierarchy with the
'svn mkdir file:///' commands, but that resulted in an authentication
failure when I tried to connect using svnserve from the client. I
deleted the directories and re-created them from the client using 'svn
mkdir svn://' as above - that seemed to solve the problem. I'm not
sure why the 'cfg' hierarchy should have been different ?

Anyway, all seems to be working fine. Many thanks to you all for the
very helpful replies.

BRgds/Alan

RE: project vs. repository

Posted by Edward Ned Harvey <sv...@nedharvey.com>.
> From: alan.james.taylor@gmail.com [mailto:alan.james.taylor@gmail.com]
> On Behalf Of Alan Taylor
> 
> My problem is that cfg should be a project within the repo
> and now I want to add another project, i.e.
> /srv/svn/cfg
> /srv/svn/pxe
> 
> What is the best way to move things around ?

This was already said by David, but it was rather buried deep in there...
So just to make sure it didn't sneak past you...

Read the man pages for each of these, cuz I'm leaving out some details.  But
these are the main ingredients.
mkdir foo
svnadmin create foo
svnadmin dump /srv/svn/cfg | svnadmin load foo --parent-dir cfg
mv /srv/svn /srv/svn_old
mv foo /srv/svn


project vs. repository

Posted by Alan Taylor <at...@ieee.org>.
Greetings,

Some time ago I created my repo with:
svnadmin create /srv/svn/cfg

This has been operating fine for over a year, but I now have
a problem because I want to add another project.
Unfortunately I think the original repo creation command
should have been:
svnadmin create /srv/svn

My problem is that cfg should be a project within the repo
and now I want to add another project, i.e.
/srv/svn/cfg
/srv/svn/pxe

What is the best way to move things around ?

Rgds/Alan

RE: project vs. repository

Posted by "Cooke, Mark" <ma...@siemens.com>.
> -----Original Message-----
> From: alan.james.taylor@gmail.com 
> [mailto:alan.james.taylor@gmail.com] On Behalf Of Alan Taylor
> Sent: 13 January 2011 00:22
> To: users@subversion.apache.org
> Subject: project vs. repository
> 
> Greetings,
> 
> Some time ago I created my repo with:
> svnadmin create /srv/svn/cfg
> 
> This has been operating fine for over a year, but I now have
> a problem because I want to add another project.
> Unfortunately I think the original repo creation command
> should have been:
> svnadmin create /srv/svn
> 
> My problem is that cfg should be a project within the repo
> and now I want to add another project, i.e.
> /srv/svn/cfg
> /srv/svn/pxe
> 
> What is the best way to move things around ?
> 
> Rgds/Alan
> 
I use svn from windows but I assume you are using some *nix flavour...

It depends on what you want to achieve.  Are the two projects related?
Some people favour keeping separate repos for separate projects (a bit
more admin to create new repos each time, my choice!) or keep everything
in one repo (more admin if when you try to archive off dead projects).

First make sure no-one is using the repo and that everything has been
checked in (not completely required but saves hassle), then shut down
however you serve your repo (apache, svnserve).

To use one repo... I would open a TortoiseSVN repo-browser window and
create a new 'cfg' folder in the repo and just move the project files
under that.  I believe that you can achieve the same from the command
line using the mv command with the appropriate two URLs.  Now you can
add a folder your second project...  You may want to move the repo up a
folder in the filesystem.

Alternatively, create your second repo just like you did the first.

The next step requires you to change the setup of how you serve your
repo (svnserve or apache will be different).  If you now have two repos
then you need to look into the ParentPath options (e.g.
http://svnbook.red-bean.com/nightly/en/svn.serverconfig.httpd.html).  If
just one repo then you might need to change the address from which the
repo is served so that /cfg is no longer a part of it (e.g. your apache
<Location> directive section)...

You will probably need to checkout new working copies from the new
locations or you could try using svn switch
(http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.switch.html)

Good luck,

~ mark c

Re: project vs. repository

Posted by Les Mikesell <le...@gmail.com>.
On 1/13/2011 10:37 AM, Daniel Shahaf wrote:
> David Weintraub wrote on Thu, Jan 13, 2011 at 11:19:54 -0500:
>> Are you using file:// URLs? You should either be using svnserve or
>> Apache httpd as your Subversion server. Fortunately, you can easily do
>> that without having to do anything with your repository. Even when I
>> have a personal Subversion repository and I'm the only user, I still
>> use svnserve.
>>
>
> I'm curious: why?
>
> Is it because you need authz, or run svnserve as a different user, or
> because you prefer to have a one-stop way to stop everything from
> accessing the repository, ...?

A big reason is so you or someone else can't delete or corrupt the whole 
repository (accidentally or otherwise) because all your programs have 
direct write access at the filesystem level.

-- 
   Les Mikesell
    lesmikesell@gmail.com


Re: project vs. repository

Posted by David Weintraub <qa...@gmail.com>.
On Thu, Jan 13, 2011 at 11:37 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> David Weintraub wrote on Thu, Jan 13, 2011 at 11:19:54 -0500:
>> Are you using file:// URLs? You should either be using svnserve or
>> Apache httpd as your Subversion server. Fortunately, you can easily do
>> that without having to do anything with your repository. Even when I
>> have a personal Subversion repository and I'm the only user, I still
>> use svnserve.
>>
>
> I'm curious: why?
>
> Is it because you need authz, or run svnserve as a different user, or
> because you prefer to have a one-stop way to stop everything from
> accessing the repository, ...?

I hope you're asking me why, as the only user for my personal
repository, I'm accessing Subversion via svnserve and not via
"file://".

Several reasons:

* It's easier to refer to my repository as
svn://localhost/blah/blah/blah rather than
file:///users/david/some/directory/to/where/I/put/my/repository/if/I/can/remember/blah/blah/blah.

* It allows me to put my repository out of "harms way", so I don't do
anything stupid and destroy my work. Doing stupid things is my
specialty. I worked in the financial industry in fixed asset
securities (i.e. CDOs) when the financial collapse happened. Mere
coincidence? I think not.

* It makes it easy to give someone else needs access to my repository
when those occasions arise. And, I can give myself remote access when
needed.

* I can pretend to be two or more separate users. This isn't because I
suffer from some abnormal split personality disorder, but because I do
Subversion administration, and it allows me to test hook scripts of
various sorts and how Subversion handles various issues.

And, svnserve is easy enough and quick enough to setup that there's
really no reason not to.

Now, if you're asking about multiple users, the big reason is to keep
everyone's grubby fingers away from directly accessing the repository.
When you use file://, every one has read/write/damage/destroy/delete
access to your repository. Not a good thing to have.

-- 
David Weintraub
qazwart@gmail.com

Re: project vs. repository

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
David Weintraub wrote on Thu, Jan 13, 2011 at 11:19:54 -0500:
> Are you using file:// URLs? You should either be using svnserve or
> Apache httpd as your Subversion server. Fortunately, you can easily do
> that without having to do anything with your repository. Even when I
> have a personal Subversion repository and I'm the only user, I still
> use svnserve.
> 

I'm curious: why?

Is it because you need authz, or run svnserve as a different user, or
because you prefer to have a one-stop way to stop everything from
accessing the repository, ...?

Re: project vs. repository

Posted by David Weintraub <qa...@gmail.com>.
Are you using file:// URLs? You should either be using svnserve or
Apache httpd as your Subversion server. Fortunately, you can easily do
that without having to do anything with your repository. Even when I
have a personal Subversion repository and I'm the only user, I still
use svnserve.

But getting back to the issue at hand: Your basic issue is that your
repository root is the project itself, and not a directory holding the
various projects. There are several ways you can handle this:

* One is a dump and reload which puts your "cfg" project under another
directory. It's simple enough to do. If you do this, all of your "cfg"
project will appear as if you've always had it setup that way. (See
http://bit.ly/fdJjX5).

* Another thing you can do is simply create another root level
directory, and then copy  your cfg project under that directory. This
is easier since you don't have to shut down your repository or do a
dump and filter. However, users should be warned in advanced that this
is taking place since it changes the URL from where  they have checked
out their code. They'll need to take this in account when they commit
their changes. Also, it can cause issues with merging since the base
URL has changed.

* Lastly, you can simply create multiple repositories with one for
each project. This has advantages and disadvantages. However, if
you're using svnserve, you'll have to use a different port for each
project. If you use Apache httpd, there's no problem running multiple
repositories on the same server.

Have you seen the Subversion on line manual at svnbook.com? It's one
of the best open source manuals I've seen and does a great job
explaining not just the fundamentals of Subversion, but many of the
ins and outs of Subversion administration.

On Wed, Jan 12, 2011 at 7:22 PM, Alan Taylor <at...@ieee.org> wrote:
> Greetings,
>
> Some time ago I created my repo with:
> svnadmin create /srv/svn/cfg
>
> This has been operating fine for over a year, but I now have
> a problem because I want to add another project.
> Unfortunately I think the original repo creation command
> should have been:
> svnadmin create /srv/svn
>
> My problem is that cfg should be a project within the repo
> and now I want to add another project, i.e.
> /srv/svn/cfg
> /srv/svn/pxe
>
> What is the best way to move things around ?
>
> Rgds/Alan
>



-- 
David Weintraub
qazwart@gmail.com