Moving files between independent repositories in SVN
After some research I have found that it is possible to move files out of one repo and into another, separate repo and still maintain the associated history. The process includes dumping the entire repo to file, filtering that dump file for the paths/files you want (assuming you don't want to move everything), then loading said dump file into the target repo.
I am finding success in the first 2 steps, but have hit a roadblock with the last step -- Loading.
From the SVN book, there is an example which suggests that any non-existant paths in the target repo will be created during the loading process:
svnadmin load --parent-dir new/subdir/for/project /var/svn/restored < repos-backup
<<< Started new txn, based on original revision 1
* adding path : test ... done.
* adding path : test/a ... done.
However, when I run the command myself (with different paths of course), I get the following:
<<< Started new transaction, based on original revision 78
svnadmin: File not found: transaction '990-tj', path 'myFolder/trunk/templates/default/fireWood'
* adding path : myFolder/trunk/templates/default/fireWood ...
I am then immediately kicked to a prompt - unclear if the process was successful or not.开发者_开发问答 Upon inspecting the repository, no new directories were created and no files were loaded. None whatsoever.
Any ideas?
I ended up explicitly creating the entire destination directory structure, then importing the filtered dump. Now that the target directories all existed, the import ran successfully.
I just ran this type of command while I was cleaning up my repos, reorganizing them. I was basicly moving all of the content from one repo to a new folder in another repo, joining similar projects.
I used
svnadmin dump d:\repoPathToMove > d:\backupFolder\repoName.dump
And used
svnadmin load d:\pathToNewRepo --parent-dir InternalFolder < d:\backupFolder\repoName.dump
At d:\pathToNewRepo is the path to the destination repo, and InternalFolder is the new folder where the loaded files will be deposited. This works if I create the InternalFolder befor doing the load. I created the Internal Folder using Toitoise SVN's RepoBrowser on the destination Browser.
Just tried running the load WITHOUT creating the folder and I got the same error you presented. SO I guess the easy way is adding a command to create the missing parent-dir.
I did not use any filtering here.You can also shorthand it a bit by writing the dump and load one after the other:
svnadmin dump d:\repoPathToMove | svnadmin load d:\pathToNewRepo --parent-dir InternalFolder
avoiding the need to create the dump file
Any ideas?
While I can't help you with the error, my idea would be to try to load without providing a path. The stuff will end up at top-level, but with SVN you can always move it around later.
(You do have some copy of your repository to try all that with, don't you?)
The problem could be in the filtering. Svndumpfilter doesn't handle all kind of dependencies and silently omits necessary revisions in several cases.
In this particular case, check that all directories are correctly created in the dumpfile before files are being added.
精彩评论