4

I had a HDD with SVN repositories and it 'died'. Until I managed to recover it, I created new repositories on another HDD and committed all the files to the new repositories starting from revision 1 and losing all history.

Now that I have recovered the old SVN repositories, I am trying to load the new repositories that I was working on in the meantime into the old repositories, so basically revision 1 of new repository must become revision 2456 of the old repository.

When I'm running the svnadmin load command I'm getting the following error:

<<< Started new transaction, based on original revision 1
     * adding path : ---------------- ...svnadmin: File already exists: filesystem 'C:\
Repositories\repname\db', transaction '2788-25k', path '----------------'

Any idea how I can 'merge' them? If it's even possible, of course...

Cœur
  • 37,241
  • 25
  • 195
  • 267
hex4
  • 695
  • 2
  • 9
  • 23

3 Answers3

2

You have to start over with a fresh repository and load the transactions from the original repository first.

svnadmin dump recovered-repo > dumpfile
svnadmin load new-repo < dumpfile

Then load the new transactions from the end of the current repository you've been working in since the crash. Be sure to specify your revisions to only take the new stuff.

svnadmin dump current-repo -r firstnewrev:lastnewref --incremental > newdumpfile
svnadmin load new-repo < newdumpfile

Because I don't have any repositories to test with, I haven't actually tested this so be careful and don't mess with anything you don't have backed up. See the free online book for more help: http://svnbook.red-bean.com/

JeffRSon
  • 10,404
  • 4
  • 26
  • 51
John Gordon
  • 2,576
  • 3
  • 24
  • 29
1

I ran into this issue when we had to migrate an old CVS repository over using cvs2svn. That process worked great, but we missed some projects initially from CVS, and the team also made some commits to CVS after the fact. SO our subsequent SVN dump had a combo of : * New projects not seen in SVN before * Existing projects already migrated to SVN, but with newer commits.

It was the second part that caused conflicts on load.

So rather then remigrating the entire CVS repo (which would have taken hours and hours) I just relied on our old friend svndumpfilter to remove the clashing paths.

  1. Filter latest dump file to exclude conflict (leave orginal diump file in palce, well need it later)
  2. Run import (repository now has latest of all projects except conflict)
  3. Now filter the latest dump to ONLY include conflict (used later)
  4. Run a dump of existing SVN repository, excluding conflicting path
  5. Filter latest dump file to include only conflict
  6. Create new empty repository
  7. Move the old repo to a safe location
  8. Import both filtered dumps into new repository

    [svnrepos]$ svndumpfilter exclude conflict-path < latestRepo.dump > repo_filtered_woConflicts.dump
    [svnrepos]$ svnadmin load REPONAME < repo_filtered_woConflicts.dump
    [svnrepos]$ svndumpfilter include conflict-path < latestRepo.dump > repo_filtered_ConflictsOnly.dump 
    [svnrepos]$ svnadmin dump REPONAME | svndumpfilter exclude conflict-path > repo_filtered_woConflicts.dump #overwrites previous filter
    [svnrepos]$ mv REPONAME REPONAME_old
    [svnrepos]$ svnadmin create REPONAME
    [svnrepos]$ chmod -R g+rwx REPONAME # if shared by apache
    [svnrepos]$ svnadmin load REPONAME < repo_filtered_woConflicts.dump
    [svnrepos]$ svnadmin load REPONAME < repo_filtered_ConflictsOnly.dump

Eddie
  • 9,696
  • 4
  • 45
  • 58
0

On my case I just removed the repos from their paths, after they got removed, they let me load the dumps into the repos location. I did something like this:

#remove old repos:

rm -rf repo_name1,repo_name2, ...., repo_name[n]

#load repos:

svnadmin load /path_to_repo/repo_name < /path_to_dump/repo_name.dump

Ricardo Rivera Nieves
  • 1,305
  • 2
  • 8
  • 7