Search code examples
svnpowershellwindows-7tortoisesvndump

svn dump -> path rename via windows powershell -> struggle with malformed dumpfile header


The title says it all :) What i want is to dump a folder from one project and store it into another. Both folders (src: proj1/trunk/supplies, dest: extlibs/trunk) are in the same repository. My problem is that the when i load the "normal" dumpfile, the previous folder's path is kept and will be recreated at the new location (extlibs/trunk/proj1/trunk/supplies). So i've tried to change the path manually with win7 powershell:

svnrdump dump https://localghost/svn/test_repo/proj1/trunk/supplies |           \ 
% {$_ -replace "Node-path: proj1", "Node-path: extlibs"} |                      \
% {$_ -replace "Node-path: extlibs/trunk/supplies", "Node-path: extlibs/trunk"}|\
Out-File foo.dmp

Alternatively, i also used this command line:

svnadmin dump <local svn dir> | svndumpfilter include proj1/trunk/supplies | \ 
% {$_ -replace "Node-path: proj1", "Node-path: extlibs"} |                   \
% {$_ -replace "Node-path: extlibs/trunk/supplies","Node-path: extlibs/trunk}|\
Out-File foo.dmp

However, when i use svnadmin load or svnrdump load to upload the path-modified dumpfile, i receive "malformed dumpfile header" error. If i change the path manually, i get MD5-checksum errors. I am really confused how to change powershell's output in order to make dump load work. I've tried

.. | Out-File -Enc UTF foo.dmp
.. | Out-File -Enc ASCII foo.dmp

Does someone of you know how to change the dumpfile's folder-path? Is my approach correct or is there a better way to change the repo-path?

I know that there are some tools out there but i can't use them now. I have to do this "by hand" in order to get a deeper understanding, but it seems that i may think too complicated.

Thanks for your help and time. I hope one of you knows how to solve this problem.


Solution

    • You must not change dump-file by hand
    • You **must* to use svndumpfilter after dumping
    • In order to change "mount-point" of folder from dump, you must to use --parent-dir options in svnadmin load

    Read here, on SO, topic SVN: how to merge tags from separate projects and (linked in answer) Using svndumpfilter to extract a folder in it's own repository blog-post