Springe zum Inhalt

Moving files from one SVN repository to another keeping the history

I recently needed to move one of my projects from one svn repository to another.

Thanks to the new svnrdump tool introduced in svn 1.7 this can be done very comfortable on any machine.

The first step is to dump you actual repository or any folder in it.

svnrdump dump http://server.local:8080/svn/project/folder > m:\projekt.dump

The second step is to load your dump back to the new repository.

svnrdump load http://server.local:8080/svn/Test1/trunk < m:\projekt.dump

And you're done. Or so I thought. If you are lucky enough not to experience the problems I came across, then your done also.

So, here some hints what to do if problems arise:

** You may encounter an E175002 error ("Repository has not been enabled to accept revision propchanges; ask the administrator to create a pre-revprop-change hook"). Thats because you are not allowed to set the rdump-lock.  You need to create a pre-revprop-change.bat (for windows) in your hooks folder, or with VisualSVN go to the properties of the repository (hooks tab) and double-click on "Pre-revision property change hook"

Just enter

exit 0

Or if you like it more advanced (I didn't test this:)

if “%4? == “svn:rdump-lock” exit 0
echo Property ‘%4? cannot be changed >&2
exit 1

You' find more information about that here: tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-repository-hooks.html

** It may happen, that the import process fails, in my case I got an error

about a premature end of file and I needed to do a new dump and import that one. I got an "Failed to get lock on destination repos" error. You'll propaply then need to remove the lock from the target repository first.

svn pd svn:rdump-lock --revprop -r 0 http://server.local:8080/svn/Test1/trunk

After that you can again try to load the dump file into the target repository.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert