Using svnsync with VisualSVN

I’ve been using Subversion for quite some time, and yet I don’t consider myself an expert on it because for the most part it just does what I need without much effort on my part. Most of that is thanks to VisualSVN Server, which makes the whole process of running Subversion in a Windows environment so incredibly easy.

All of that is a bit of a long introduction to what’s going to be an incredibly short post about getting svnsync up and running with VisualSVN server. If you don’t know what svnsync is then you can probably guess from the name alone – it’s Subversion’s way of replicating a repository, something I’m doing to an offsite location as an additional layer of backup for my code.

There’s a range of good guides out there which cover configuring and using svnsync which should give you most of what you need to get up and running, but I’m going to add a couple of quick notes from my experiences below:

1. Configuring the pre-revprop-change-hook in VisualSVN in the destination repositorythe guide I mentioned earlier gives a Unix specific example, and I found a lot of other people talking about this hook in the context of svnsync without anyone mentioning the simple fact that this hook needs to exist, but it can be blank. From VisualSVN Manager, right click on your repo and select “All Tasks \ Manage Hooks”. Select “Pre-revision property change hook” and edit that – enter a couple of blank lines then click ok. Done. The hook will now be listed in bold indicating it exists.

If you don’t have this configured, then you’ll get an error saying “svnsync: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent” when you try and sync or init.

2. Credentials – you should only need to enter your repository credentials when you perform the init of the mirrored repository. For some reason, my first sync failed until I provided credentials, but subsequent sync operations appear to be working fine.

And that’s it!

 Print | Posted on Monday, April 27, 2009 9:41 PM |



Feedback

Gravatar

# re: Using svnsync with VisualSVN

Thanks. Most helpful!

5/6/2009 2:42 PM | Wayne

Gravatar

# re: Using svnsync with VisualSVN

tfs2svn would not work without this... much appreciated...

7/15/2009 6:52 AM | c60

Gravatar

# re: Using svnsync with VisualSVN

So, visualSVN and svnsync, how do i go about finding the path to the svnsync.exe file? the default location for visualSVN is in the programs files/visualSVN Server/bin directory, but it seems like the spaces in the words is a problem.
my post commit file calls the following code to try to do the sync:

svnsync initialize https://target/myproject/ https://source/myproject/ \
--sync-username svnsync --sync-password syncpassword \
--source-username sourceusername --source-password sourcepassword

set SVNSYNC=/usr/bin/svnsync
set TO=http://my.slave.machine/myproject/
set SYNC_USER=svnsync
set SYNC_PASS=syncpassword
set SOURCE_USER=me
set SOURCE_PASS=mypassword

%SVNSYNC% --non-interactive sync %TO% \
--sync-username %SYNC_USER% --sync-password %SYNC_PASS% \
--source-username %SOURCE_USER% --source-password %SOURCE_PASS% & exit 0

I think this will work, however, the svnsync variable above is /usr/bin/svnsync, but that location does not exist...can you help me figure out how to add the proper path to replace the above code?

thanks
dan

7/17/2009 12:10 AM | Dan Fredericks

Gravatar

# re: Using svnsync with VisualSVN

Thanks very much.. this helped me a lot.

9/17/2009 10:16 PM | SK

Gravatar

# re: Using svnsync with VisualSVN

Thanks wouldn't have thought about this on myself.
@dan (ok I know this post is long time ago, perhaps it helps someone else)
It's standard windws behaviour, just take apostrophes cause of the blanks.
At the startof your script you can put this two lines
C:
cd "C:\Program Files\VisualSVN Server\bin\"

An then you can execute svnsync just as normal.

2/10/2010 8:44 PM | Cyb1000

Gravatar

# re: Using svnsync with VisualSVN

Great info on this post! Thanks for making it so clear!

3/22/2010 8:45 PM | club penguin

Gravatar

# re: Using svnsync with VisualSVN

One remembers that life seems to be not very cheap, however we need cash for different stuff and not every person earns enough cash. Therefore to receive fast home loans and college loan would be good solution.

3/26/2010 6:11 PM | Eula20Gould


Post Comment

Title  
Name  
Email
Website / Url
 

Your comment

   
Ensure the word in this box says 'orange':
 
Please add 4 and 5 and type the answer here:





Due to excessive comment spam, all comments are now being moderated. If you're a comment spammer then you're wasting your time here. Your comments will not be published - ever.


About me

My name is Ross Hawkins and I'm a developer, consultant, business owner and writer based in Auckland, New Zealand (pictured below!). My current work revolves around ASP.NET, C#, jQuery, Ajax, SQL Server, and a mix of other Microsoft development technologies.

I also have about 15 years of experience with IBM Lotus Notes/Domino and associated technologies. While Notes/Domino is no longer my primary focus I still like to dabble and keep my skills up to date.

I own and run 2 businesses - Hawkins Consulting Services, and Ignition Development.

Bethells Beach, located in sunny West Auckland, New Zealand




Subscribe

Subscribe to this feed


Search




Popular Content

Troubleshooting WebResource.axd

The .NET 2.0 framework changed the way clientside JavaScript is delivered to the browser. Previously, ASP.NET 1.1 used the aspnet_client directory whereas now 2.0 uses WebResource.axd.

Published on October 8, 2006

Microsoft AJAX Extensions: Sys.Debug is null or not an object

One of the breaking changes which was made with the 1.0 release of the Microsoft Ajax Extensions was the renaming of the 'Debug' class to 'Sys.Debug' for reasons of compatiability with other frameworks. Breaking changes like this can often be a source of frustration..

Published on May 22, 2007

Simple ASP.NET Character Counter

A textbox character counter is a pretty simple piece of functionality, and there's a lot of different ways to apply one to your application. The following method is nice and simple, and can be done using only clientside JavaScript if required, or combined with server side code in order to create a more dynamic effect

Published on December 4, 2006

Simple ASP.NET Character Counter - with Master Page Support

A quick update to my previous character counter article adding some changes for those using it with Master Pages.

Published on February 7th, 2009

Adding Tooltips to Gridview Headers

As the title says, this is a very simple but dynamic way of achieving tooltip text on a header column. It's not overly flash, but it's lightweight and quick to implement.

Published on April 15, 2007

SQL Server Web Report Viewer Issues on Windows 2008 Server/IIS7

A fix for another AXD related issue, this time with the SQL Server Web Report Viewer Control which was being served up via IIS7 on a Windows 2008 server.

Published on June 2, 2007
Updated on April 10, 2008




Archives

January, 2012 (3)
December, 2011 (3)
November, 2011 (8)
October, 2011 (9)
September, 2011 (8)
August, 2011 (5)
July, 2011 (4)
June, 2011 (7)
May, 2011 (5)
April, 2011 (3)
March, 2011 (8)
February, 2011 (4)
January, 2011 (3)
December, 2010 (8)
November, 2010 (5)
October, 2010 (6)
September, 2010 (7)
August, 2010 (11)
July, 2010 (12)
June, 2010 (8)
May, 2010 (8)
April, 2010 (4)
March, 2010 (8)
February, 2010 (6)
January, 2010 (12)
December, 2009 (13)
November, 2009 (11)
October, 2009 (12)
September, 2009 (12)
August, 2009 (2)
July, 2009 (7)
June, 2009 (12)
May, 2009 (9)
April, 2009 (9)
March, 2009 (9)
February, 2009 (8)
January, 2009 (7)
December, 2008 (6)
November, 2008 (7)
October, 2008 (9)
September, 2008 (12)
August, 2008 (9)
July, 2008 (6)
June, 2008 (24)
May, 2008 (13)
April, 2008 (16)
March, 2008 (8)
February, 2008 (10)
January, 2008 (1)
December, 2007 (14)
November, 2007 (11)
October, 2007 (11)
September, 2007 (13)
August, 2007 (11)
July, 2007 (5)
June, 2007 (15)
May, 2007 (11)
April, 2007 (9)
March, 2007 (9)
February, 2007 (10)
January, 2007 (8)
December, 2006 (18)
November, 2006 (11)
October, 2006 (14)
September, 2006 (9)
August, 2006 (10)
July, 2006 (4)
June, 2006 (4)
May, 2006 (6)
April, 2006 (3)
February, 2006 (6)
January, 2006 (10)
September, 2005 (2)
August, 2005 (4)

Post Categories

ASP.NET
AJAX
Amusing
NZ
NZ Trains
Notes/Domino
Visual Studio
Web Development
Miscellaneous
Me
Rugby
C#
SQL