Friday, November 13, 2009

Move SVN project to a different repository

I had an SVN repository containing multiple projects in location "D:\svn":
D:\>svnlook tree svn -N
I needed to move my project "jarmel" to a totally different repository (at How did I do that?
  1. Dumped the whole repository (containing all projects: TarantinoSamples, wilser, oscommercel, jarmel) into a file "svn.dump":
    D:\svnadmin dump svn > svn.dump
  2. Filtered the dump to include only the "jarmel" project.
    D:\svndumpfilter include jarmel < svn.dump > jarmel.dump
  3. Hand-edited the file jarmel.dump to remove the initial adding of root directory "jarmel":
    Node-path: jarmel
    Node-action: add
    Node-kind: dir
    Prop-content-length: 10
    Content-length: 10
  4. Hand-edited the file jarmel.dump to replace all paths "jarmel/x/y/z" with "x/y/z":
    Find: "Node-path: jarmel/"
    Replace with: "Node-path: "
    Find: "Node-copyfrom-path: jarmel/"
    Replace with: "Node-copyfrom-path: "
  5. Import the new repository into newly created directory "D:\svnjarmel":
    D:\>svnadmin load svnjarmel --ignore-uuid svnjarmel < jarmel.dump

No comments: