2

I have an SVN repository containing multiple top-level folders, one per project. Inside each project folder is the usual trunk, branches, tags.

I need to move one of these project folders into its own independent repository for export and subsequent import on to another server. The new single-project repository must contain only the revision history for that project, and none from the other projects.

Any ideas on how best to proceed?

Server is VisualSVN Server on Windows, although this shouldn't make any difference.

3 Answers 3

9

You can use svnadmin dump, pipe the output through svndumpfilter and the output of that to svnadmin load.

The svndumpfilter is made to do exactly what you want to do. You can use the include subcommand to specify the project you want in the repository and leave out the rest.

The svnadmin load allows you to specify the directory in the repository where you want the output stored.

Take a look at the Repository Maintenance section of the on line manual.

Sign up to request clarification or add additional context in comments.

2 Comments

Perfect solution. svnadmin dump i:\repos\myrepo > myrepo.dmp then svndumpfilter include MyProject --renumber-revs > filtered.dmp < myrepo.dmp then svnadmin load i:\repos\MyNewEmptyRepo < filtered.dmp
Use --quiet for faster dump and filtering (it won't ouput stuff to the console)
1
  1. In TortoiseSVN you have the option to export a project from the repository (strips svn information).
  2. Create your new Repo on the server
  3. Checkout the new SVN repo to your drive
  4. copy the exported files to the new repo
  5. Commit.

There you go, new clean repo.

3 Comments

Great, but no version history is retained.
I think most developers will want to retain their version history.
I don't disagree, version history is a necessity.
0

One thing to do, is to take a sequence of svn dumps of the check-ins done for that folder. Name them according to their revision number. Now in your new SVN repo, import them in order. Try it out on a test repo to iron out kinks if any but this should be doable. Use the svndump command detailed here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.