You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Tech Geek <te...@gmail.com> on 2010/10/05 19:47:22 UTC

Importing Existing Repository into a New Repository

I have an exisiting repository at /var/lib/svn/projectA with (tags,
branches, trunk structure) whose HEAD is at Revision 25

I just created a new/fresh repository at /var/lib/svn/projectB with (tags,
branches, trunk structure) whose HEAD is at Revision 1 (because of importing
the tags, branches and trunk structure). Now I would like to import the
projectA repository into projectB with increasing HEAD of projectB up to
revision 25.

svn import commands is only for unversioned files. svn dump and svn load
will increase the revision number.

How can I do this? Should I just checkout a WC of projectA and then delete
the .svn folder from it and then import it into projectB increasing revision
of projectB to 2 which is fine?

Is there a better way?

Thanks.

Re: Importing Existing Repository into a New Repository

Posted by Tech Geek <te...@gmail.com>.
>
> svnadmin dump -rHEAD /path/to/oldrepo > dump
> svnadmin load /path/to/newrepo < dump
>
Thanks Ryan! That worked!

Re: Importing Existing Repository into a New Repository

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Oct 6, 2010, at 07:03, Nico Kadel-Garcia wrote:

> 2010/10/5 Ryan Schmidt:
>> 
>> If you do not want to preserve the history, then you want to "svn export" from the old repository and "svn import" it into the new repository.
> 
> You'll also want to seriously review the Subversion properties of the
> material before the export, in order to replicate them in the imported
> or "added" material. svn:externals, svn:keywords, svn:eol, etc., etc.,
> etc. are not contained in an export: they're meta data in the
> Subversion repository, not the raw or even processed content of the
> exported files. This includes svn:eol, svn:keywords, and in particular
> svn:external. svn:keywords in particular, will create fascinating and
> confusing content in the keywords of the files at the time of your
> original import, so this is something to do cautiously.
> 
> This is one of those cases where a bit of extra attention, instead of
> "just export it and import it" can save you some surprises down the
> road.

Ah yes, this is true. If properties are of interest, then an alternative to svn exporting, manually fixing the properties, and svn importing, is to svnadmin dump just the HEAD revision and then svnadmin load it:

svnadmin dump -rHEAD /path/to/oldrepo > dump
svnadmin load /path/to/newrepo < dump

This will dump only a single revision representing the state of the old repo at HEAD, and will preserve properties. In between dump and load you can use svndumpfilter if you wish to exclude parts of the dump (or include only certain parts), and you can use svnadmin load's --parent-dir argument if you want to change where the contents are loaded (or just use "svn mv" after loading).



Re: Importing Existing Repository into a New Repository

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
2010/10/5 Ryan Schmidt <su...@ryandesign.com>:
>
> On Oct 5, 2010, at 15:22, Tech Geek wrote:
>
>> and load project a as project b and take all the history with you.
>> Just create a new project b without adding trunk etc. in revision 1.
>> I do not want all the revision history of projectA into projectB. I just need to start projectB with the latest code (trunk HEAD of) projectA.
>>
>> May be I am missing something very obvious here...
>
> If you do not want to preserve the history, then you want to "svn export" from the old repository and "svn import" it into the new repository.

You'll also want to seriously review the Subversion properties of the
material before the export, in order to replicate them in the imported
or "added" material. svn:externals, svn:keywords, svn:eol, etc., etc.,
etc. are not contained in an export: they're meta data in the
Subversion repository, not the raw or even processed content of the
exported files. This includes svn:eol, svn:keywords, and in particular
svn:external. svn:keywords in particular, will create fascinating and
confusing content in the keywords of the files at the time of your
original import, so this is something to do cautiously.

This is one of those cases where a bit of extra attention, instead of
"just export it and import it" can save you some surprises down the
road.

Re: Importing Existing Repository into a New Repository

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Oct 5, 2010, at 15:22, Tech Geek wrote:

> and load project a as project b and take all the history with you.
> Just create a new project b without adding trunk etc. in revision 1.
> I do not want all the revision history of projectA into projectB. I just need to start projectB with the latest code (trunk HEAD of) projectA.
>  
> May be I am missing something very obvious here...

If you do not want to preserve the history, then you want to "svn export" from the old repository and "svn import" it into the new repository.



Re: Importing Existing Repository into a New Repository

Posted by Tech Geek <te...@gmail.com>.
>
> and load project a as project b and take all the history with you.
> Just create a new project b without adding trunk etc. in revision 1.
>
I do not want all the revision history of projectA into projectB. I just
need to start projectB with the latest code (trunk HEAD of) projectA.

May be I am missing something very obvious here...

Re: Importing Existing Repository into a New Repository

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Tech Geek,
am Dienstag, 5. Oktober 2010 um 21:47 schrieben Sie:

> Is there a better way?

I didn't really understand what exactly your requirements regarding
the revision number of project b are, but it seems you can just dump
and load project a as project b and take all the history with you.
Just create a new project b without adding trunk etc. in revision 1.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning
AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
 
Telefon: Potsdam: 0331-743881-0
E-Mail:  tschoening@am-soft.de
Web:     http://www.am-soft.de

AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow