JsatherMain Page | About | Help | FAQ | Special pages | Log in

Printable version | Disclaimers | Privacy policy

Cheating svnsync to work with an old backup

From Jsather

SVNSYNC -- Cheating When You Create a Slave

Overview

Generally, svnsync requires a few things. First, you need an empty repository. Second, you need to run svnsnc init. Finally, you need to actually do the sync. If you already have a mirrored repository done by something like rsync, you can save some time by cheating and directly modifying the remote repository's revprops.

The following naming conventions will be used through: Slave - the remote copy of the repository Master - the main copy of the repository REPO - a repository URL reference Things in parenthesis should be replaces with actual values.

Changing the Backup to a Slave

First, if there are any existing syncs running or queued, they need to be disabled. In our case we just turned off the cron routine.

We now need to upgrade the repositories to both support the latest version of subversion:

svnadmin upgrade REPO

Next, we need to create a simple pre-revprop-change file for the new slave. Generally, you can just add the call out to the shell:

#!/bin/sh

We can now start editing the existing revprops.

First, we set the master and bind it to the slave: svn propset svn:sync-from-url --revprop -r 0 (Master URL) (Slave URL)

We need to get some information for the next steps. First, get the current revision of the Slave: svnlook youngest Slave

svn propset svn:sync-last-merged-rev --revprop -r 0 (NUMBER FROM PREVIOUS COMMAND) (Slave URL)

Now we need to get the repository UUID and add it to a revprop: svnadmin dump -r0 (SLAVE) | head -n 3

svn propset svn:sync-from-uuid --revprop -r 0 (UUID FROM PREVIOUS COMMAND) (Slave URL)

Testing the Conversion

You can test the conversion with the following command: svnsync sync (Slave URL)

Notes

There are a number of additional steps that have be done for actually getting the actual Master-->Slave relationship working. See the red-book doc for more details.

Errors

svnsync: Destination HEAD (24) is not the last merged revision (0); have you committed to the destination without using svnsync? This error means that you didn't set the sync-last-merged-rev number correctly.

svnsync: Destination repository has not been initialized This means that you didn't set the sync-from-url correctly

apache: issues with SSL on the copy from the Slave to the Master. You need to modify the SSL directives and enable SSLProxyEngine and SSLProxyMachineCertificateFile. These can be done in the ssl.conf on Fedora.

Retrieved from "http://www.jsather.com/wiki/index.php/Cheating_svnsync_to_work_with_an_old_backup"

This page has been accessed 857 times. This page was last modified on 31 August 2008, at 03:19.


Find

Browse
Main Page
Community portal
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
New section
Printable version
Context
Page history
What links here
Related changes
My pages
Log in / create account
Special pages
New pages
File list
Statistics
More…