1

We have a corporate SVN repository with many projects being hosted, each with its own branches/trunk/tags. My team is only interested in 2 projects.

So I created 2 dump files using svnrdump. Now I'm trying to load them into my local SVN. But I would like to preserve the revision numbers. When I load the first project, revision numbers are correct. But when I load the second project, revision number resumes where the first project ended. This is true when I tried with svnrdump and also with svnadmin.

Is there a way to create a single dump file for 2 selected projects ?

bahrep
  • 26,679
  • 12
  • 95
  • 136
Sony Antony
  • 121
  • 8

1 Answers1

1

Use svnadmin dump with the --include or --pattern arguments to generate one repository dump stream preserving revision numbers.

For instance, the command should look as follows:

svnadmin dump MYREPO --include /project1 --include /project2 --file myrepodumpfile.svndump

Here is a part of svnadmin help dump help:

  --exclude ARG            : filter out nodes with given prefix(es) from dump
  --include ARG            : filter out nodes without given prefix(es) from dump
  --pattern                : treat the path prefixes as file glob patterns.
                             Glob special characters are '*' '?' '[]' and '\'.
                             Character '/' is not treated specially, so
                             pattern /*/foo matches paths /a/foo and /a/b/foo.
                                 pattern /*/foo matches paths /a/foo and /a/b/foo.

BTW, you can improve performance of svnadmin dump by adding the -M 256 argument.:

  -M [--memory-cache-size] ARG : size of the extra in-memory cache in MB used to
                             minimize redundant operations. Default: 16.
                             [used for FSFS repositories only]
bahrep
  • 26,679
  • 12
  • 95
  • 136
  • This is good ( Thank You ). However, I don't have shell access to the source svn. I took the dumps using _svnrdump_ – Sony Antony May 04 '20 at 16:34
  • @SonyAntony that's not a problem. Generate a full dump with svnrdump, load it into a new empty repository on your computer and then use `svnadmin dump` as suggested above. – bahrep May 04 '20 at 16:35
  • That is also not possible. The source repository belongs to the Corporation - They have so many projects hosted there ( The two projects I need alone are 110 GB. But teh repository has multiple TBs of data ) – Sony Antony May 04 '20 at 16:59
  • @SonyAntony The I don't see any other options. You are trying to perform a complex repository administration task without having admin privileges and access to the repository. Contact the repo's admin for assistance. – bahrep May 04 '20 at 17:00
  • Thank you for confirming @bahrep – Sony Antony May 04 '20 at 17:01
  • @SonyAntony BTW, I don't understand why you need to export those two projects with revision history to another repository. Normally there should be no practical use for that unless you are migrating the projects to another server or to another company. – bahrep May 04 '20 at 17:03
  • Our corporation is moving from svn to Git. But in doing so, it seems, they lost file histories fir a whole bunch of files in Git.. So Im trying to preserve the file histories by hosting a local svnserve with only the projects that interests my team @bahrep – Sony Antony May 04 '20 at 17:07
  • BTW : Can I use something like `svnrdump | svndumpfilter include --pattern proj1 --pattern proj2 > combined2projects.dump` and then load the projects as before ? – Sony Antony May 04 '20 at 17:10
  • that’s essentially the same solution as this one https://stackoverflow.com/questions/61595939/how-to-load-partial-repository-dump-without-changing-revision-numbers/61596590?noredirect=1#comment108958534_61596590 but passing svnrdump ‘s output to svndumpfilter is much more error prone than generating the dump to a file, loading it into a repository and using svnadmin dump with the include argument. – bahrep May 04 '20 at 17:13
  • Thank you Again @bahrep – Sony Antony May 04 '20 at 17:21