user1928935
user1928935

Reputation: 31

Issue with svnsync

I am setting up an SVN mirror and I followed these steps in sequence:

  1. Created repository
  2. Loaded dump from main repository to mirror
  3. setup hook scripts
  4. Tried svnsync synchronize destination source

However I got the error on the last step:

svnsync: Destination repository has not been initialized

I should have run svnsync initialize after the repository creation but I missed it. Now, as per the svnsync command, I cannot sync until I initialize but I cannot initialize because I already have revisions committed.

The only option I have is to start from scratch and follow the correct order of steps, but it is time-consuming as I will have to load 200 000+ revisions in the mirror.

Is there a workaround to the problem?

Upvotes: 2

Views: 2997

Answers (2)

code7amza
code7amza

Reputation: 181

you can use the option "--allow-non-empty" (as of svn 1.7 atleast)

svnsync initialize dest source --allow-non-empty

however all the commits of the destination should be in source (it's okay if there are more commits in the source, they will get synched the first time you do 'synchronize').

Upvotes: 1

gbjbaanb
gbjbaanb

Reputation: 52659

The other way to do it is to start a sync with a clean backup repo, then stop it and copy the dump over the top. The information controlling the sync is stored in revision/revprop 0. Look at it before and after you copy the dump over and you'll be able to update it manually. Its a bit of a hack but its straightforward. You'll need to change the last updated revision number accordingly, or it'll try to sync all revisions.

Upvotes: 0

Related Questions